<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<body class="hold-transition skin-blue sidebar-mini" onmousedown="xyh.disableRight()"
      oncontextmenu="xyh.disableRight()">
<!--编辑模态框-->
<div class="modal fade" id="modal-edit">
    <div class="modal-dialog" style="width:500px">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">编辑</h4>
            </div>
            <form id="edit-form" class="form-horizontal">
                <div class="modal-header ">
                    <input name="id" type="hidden" style="display: none"/>
                    <input name="priceType" type="hidden"/>
                    <div class="col-md-12">
                        <div class="form-group">
                            <label class="control-label">单价:</label>
                            <label class="control-label">
                                <input name="price" type="number" class="form-control" min="0" max="210000000"
                                       step="0.01"/>
                            </label>
                        </div>
                    </div>
                </div>

                <div class="modal-footer">
                    <button type="button" class="btn btn-info file-contract btn-file" id="btn-save-edit">保存</button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                </div>
            </form>
        </div>
    </div>
</div>
<!--原材料导入-->
<div class="modal fade" id="modal-import">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">Excel信息导入</h4>
            </div>
            <div class="modal-body">
                <form id="importForm">
                    <div class="form-group">
                        <label>模版</label>
                        <a id="a-xlsxTemplate" th:href="@{/file/原材料计划模板.xlsx}">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>上次导入错误数据</label>
                        <a id="download-error"
                           th:data-url="@{/files/{user}/errorMat.xlsx(user=${session.user.account})}"
                           href="javascript:void(0);">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>选择Excel文件并上传</label>
                        <input class="btn" type="file" multiple="multiple" name="file">
                        <p class="help-block">请按模板格式进行导入，信息与模板信息对应。</p>
                        <input type="hidden" style="display: none" name="batId" th:value="${cost.batId}"/>
                        <input type="hidden" style="display: none" name="id" th:value="${cost.id}"/>
                        <input type="hidden" style="display: none" name="part" th:value="${cost.part}"/>

                        <input type="hidden" style="display: none" name="proCode" th:value="${project.code}"/>
                        <input type="hidden" style="display: none" name="major" th:value="${cost.major}"/>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-upload" type="button" class="btn btn-success">
                    <span class="Bold">上传</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--外购件 备品备件 随机备件导入-->
<div class="modal fade" id="modal-import-pur">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">Excel信息导入</h4>
            </div>
            <div class="modal-body">
                <form id="importPurForm">
                    <div class="form-group">
                        <label>模版</label>
                        <a id="a-xlsxTemplate-pur" th:if="${#strings.contains(cost.code,'外购费')}" th:href="@{/file/外购费计划模板.xlsx}">点击下载</a>
                        <a id="a-xlsxTemplate-pur" th:if="${#strings.contains(cost.code,'备品备件')}" th:href="@{/file/备品备件模板.xlsx}">点击下载</a>
                        <a id="a-xlsxTemplate-pur" th:if="${#strings.contains(cost.code,'随机备件')}" th:href="@{/file/随机备件模板.xlsx}">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>上次导入错误数据</label>
                        <a id="download-error-pur"
                           th:data-url="@{/files/{user}/errorPur.xlsx(user=${session.user.account})}"
                           href="javascript:void(0);">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>选择Excel文件并上传</label>
                        <input class="btn" type="file" multiple="multiple" name="file">
                        <p class="help-block">请按模板格式进行导入，信息与模板信息对应。</p>
                        <input type="hidden" style="display: none" name="batId" th:value="${cost.batId}"/>
                        <input type="hidden" style="display: none" name="id" th:value="${cost.id}"/>
                        <input type="hidden" style="display: none" name="part" th:value="${cost.part}"/>
                        <input type="hidden" style="display: none" name="costId" th:value="${cost.id}"/>
                        <input type="hidden" style="display: none" name="proCode" th:value="${project.code}"/>
                        <input type="hidden" style="display: none" name="major" th:value="${cost.major}"/>
                        <input type="hidden" style="display: none" name="priceType" value="2"/>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-upload-pur" type="button" class="btn btn-success">
                    <span class="Bold">上传</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--整体外协导入-->
<div class="modal fade" id="modal-import-whole">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">Excel信息导入</h4>
            </div>
            <div class="modal-body">
                <form id="importWholeForm">
                    <div class="form-group">
                        <label>模版</label>
                        <a id="a-xlsxTemplate-whole" th:href="@{/file/整体外协模板.xlsx}">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>上次导入错误数据</label>
                        <a id="download-error-whole"
                           th:data-url="@{/files/{user}/errorWithMat.xlsx(user=${session.user.account})}"
                           href="javascript:void(0);">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>选择Excel文件并上传</label>
                        <input class="btn" type="file" multiple="multiple" name="file">
                        <p class="help-block">请按模板格式进行导入，信息与模板信息对应。</p>
                        <input type="hidden" style="display: none" name="batId" th:value="${cost.batId}"/>
                        <input type="hidden" style="display: none" name="id" th:value="${cost.id}"/>
                        <input type="hidden" style="display: none" name="part" th:value="${cost.part}"/>
                        <input type="hidden" style="display: none" name="costId" th:value="${cost.id}"/>
                        <input type="hidden" style="display: none" name="proCode" th:value="${project.code}"/>
                        <input type="hidden" style="display: none" name="major" th:value="${cost.major}"/>
                        <input type="hidden" style="display: none" name="priceType" value="2"/>
                        <input type="hidden" style="display: none" name="isEffectiveFlag" value="1"/>
                        <input type="hidden" style="display: none" name="isPrototypeDataFlag" value="0"/>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-upload-whole" type="button" class="btn btn-success">
                    <span class="Bold">上传</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--带料外协导入-->
<div class="modal fade" id="modal-import-withMat">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">Excel信息导入</h4>
            </div>
            <div class="modal-body">
                <form id="importwithMatForm">
                    <div class="form-group">
                        <label>模版</label>
                        <a id="a-xlsxTemplate-withMat" th:href="@{/file/带料外协模板.xlsx}">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>上次导入错误数据</label>
                        <a id="download-error-withMat"
                           th:data-url="@{/files/{user}/errorWithMat.xlsx(user=${session.user.account})}"
                           href="javascript:void(0);">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>选择Excel文件并上传</label>
                        <input class="btn" type="file" multiple="multiple" name="file">
                        <p class="help-block">请按模板格式进行导入，信息与模板信息对应。</p>
                        <input type="hidden" style="display: none" name="batId" th:value="${cost.batId}"/>
                        <input type="hidden" style="display: none" name="id" th:value="${cost.id}"/>
                        <input type="hidden" style="display: none" name="part" th:value="${cost.part}"/>
                        <input type="hidden" style="display: none" name="costId" th:value="${cost.id}"/>
                        <input type="hidden" style="display: none" name="proCode" th:value="${project.code}"/>
                        <input type="hidden" style="display: none" name="major" th:value="${cost.major}"/>
                        <input type="hidden" style="display: none" name="priceType" value="2"/>
                        <input type="hidden" style="display: none" name="isEffectiveFlag" value="1"/>
                        <input type="hidden" style="display: none" name="isPrototypeDataFlag" value="0"/>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-upload-withMat" type="button" class="btn btn-success">
                    <span class="Bold">上传</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--安装工时导入-->
<div class="modal fade" id="modal-import-install">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">Excel信息导入</h4>
            </div>
            <div class="modal-body">
                <form id="importInstallForm">
                    <div class="form-group">
                        <label>模版</label>
                        <a id="a-xlsxTemplate-install" th:href="@{/file/安装工时模板.xlsx}">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>上次导入错误数据</label>
                        <a id="download-error-install"
                           th:data-url="@{/files/{user}/errorInstall.xlsx(user=${session.user.account})}"
                           href="javascript:void(0);">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>选择Excel文件并上传</label>
                        <input class="btn" type="file" multiple="multiple" name="file">
                        <p class="help-block">请按模板格式进行导入，信息与模板信息对应。</p>
                        <input type="hidden" style="display: none" name="batId" th:value="${cost.batId}"/>
                        <input type="hidden" style="display: none" name="id" th:value="${cost.id}"/>
                        <input type="hidden" style="display: none" name="part" th:value="${cost.part}"/>
                        <input type="hidden" style="display: none" name="costId" th:value="${cost.id}"/>
                        <input type="hidden" style="display: none" name="proCode" th:value="${project.code}"/>
                        <input type="hidden" style="display: none" name="major" th:value="${cost.major}"/>
                        <input type="hidden" style="display: none" name="priceType" value="2"/>
                        <input type="hidden" style="display: none" name="isEffectiveFlag" value="1"/>
                        <input type="hidden" style="display: none" name="isPrototypeDataFlag" value="0"/>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-upload-install" type="button" class="btn btn-success">
                    <span class="Bold">上传</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--调试工时导入-->
<div class="modal fade" id="modal-import-debug">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">Excel信息导入</h4>
            </div>
            <div class="modal-body">
                <form id="importDebugForm">
                    <div class="form-group">
                        <label>模版</label>
                        <a id="a-xlsxTemplate-debug" th:href="@{/file/调试工时模板.xlsx}">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>上次导入错误数据</label>
                        <a id="download-error-debug"
                           th:data-url="@{/files/{user}/errorDebug.xlsx(user=${session.user.account})}"
                           href="javascript:void(0);">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>选择Excel文件并上传</label>
                        <input class="btn" type="file" multiple="multiple" name="file">
                        <p class="help-block">请按模板格式进行导入，信息与模板信息对应。</p>
                        <input type="hidden" style="display: none" name="batId" th:value="${cost.batId}"/>
                        <input type="hidden" style="display: none" name="id" th:value="${cost.id}"/>
                        <input type="hidden" style="display: none" name="part" th:value="${cost.part}"/>
                        <input type="hidden" style="display: none" name="costId" th:value="${cost.id}"/>
                        <input type="hidden" style="display: none" name="proCode" th:value="${project.code}"/>
                        <input type="hidden" style="display: none" name="major" th:value="${cost.major}"/>
                        <input type="hidden" style="display: none" name="priceType" value="2"/>
                        <input type="hidden" style="display: none" name="isEffectiveFlag" value="1"/>
                        <input type="hidden" style="display: none" name="isPrototypeDataFlag" value="0"/>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-upload-debug" type="button" class="btn btn-success">
                    <span class="Bold">上传</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--安装辅材导入-->
<div class="modal fade" id="modal-import-aux">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">Excel信息导入</h4>
            </div>
            <div class="modal-body">
                <form id="importAuxForm">
                    <div class="form-group">
                        <label>模版</label>
                        <a id="a-xlsxTemplate-aux" th:href="@{/file/安装辅材模板.xlsx}">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>上次导入错误数据</label>
                        <a id="download-error-aux"
                           th:data-url="@{/files/{user}/errorAux.xlsx(user=${session.user.account})}"
                           href="javascript:void(0);">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>选择Excel文件并上传</label>
                        <input class="btn" type="file" multiple="multiple" name="file">
                        <p class="help-block">请按模板格式进行导入，信息与模板信息对应。</p>
                        <input type="hidden" style="display: none" name="batId" th:value="${cost.batId}"/>
                        <input type="hidden" style="display: none" name="id" th:value="${cost.id}"/>
                        <input type="hidden" style="display: none" name="part" th:value="${cost.part}"/>
                        <input type="hidden" style="display: none" name="costId" th:value="${cost.id}"/>
                        <input type="hidden" style="display: none" name="proCode" th:value="${project.code}"/>
                        <input type="hidden" style="display: none" name="major" th:value="${cost.major}"/>
                        <input type="hidden" style="display: none" name="priceType" value="2"/>
                        <input type="hidden" style="display: none" name="isEffectiveFlag" value="1"/>
                        <input type="hidden" style="display: none" name="isPrototypeDataFlag" value="0"/>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-upload-aux" type="button" class="btn btn-success">
                    <span class="Bold">上传</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--运输费导入-->
<div class="modal fade" id="modal-import-transport">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">Excel信息导入</h4>
            </div>
            <div class="modal-body">
                <form id="importTransportForm">
                    <div class="form-group">
                        <label>模版</label>
                        <a id="a-xlsxTemplate-transport" th:href="@{/file/运输费模板.xlsx}">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>上次导入错误数据</label>
                        <a id="download-error-transport"
                           th:data-url="@{/files/{user}/errorTransport.xlsx(user=${session.user.account})}"
                           href="javascript:void(0);">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>选择Excel文件并上传</label>
                        <input class="btn" type="file" multiple="multiple" name="file">
                        <p class="help-block">请按模板格式进行导入，信息与模板信息对应。</p>
                        <input type="hidden" style="display: none" name="batId" th:value="${cost.batId}"/>
                        <input type="hidden" style="display: none" name="id" th:value="${cost.id}"/>
                        <input type="hidden" style="display: none" name="part" th:value="${cost.part}"/>
                        <input type="hidden" style="display: none" name="costId" th:value="${cost.id}"/>
                        <input type="hidden" style="display: none" name="proCode" th:value="${project.code}"/>
                        <input type="hidden" style="display: none" name="major" th:value="${cost.major}"/>
                        <input type="hidden" style="display: none" name="priceType" value="2"/>
                        <input type="hidden" style="display: none" name="isEffectiveFlag" value="1"/>
                        <input type="hidden" style="display: none" name="isPrototypeDataFlag" value="0"/>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-upload-transport" type="button" class="btn btn-success">
                    <span class="Bold">上传</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--下料导入-->
<div class="modal fade" id="modal-import-cut">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">Excel信息导入</h4>
            </div>
            <div class="modal-body">
                <form id="importCutForm">
                    <div class="form-group">
                        <label>工时模版</label>
                        <a th:href="@{/file/下料工时模板.xlsx}">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>辅材模版</label>
                        <a th:href="@{/file/下料辅材模板.xlsx}">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>工时上次导入错误数据</label>
                        <a id="download-error-cut-hours"
                           th:data-url="@{/files/{user}/errorCutHours.xlsx(user=${session.user.account})}"
                           href="javascript:void(0);">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>辅材上次导入错误数据</label>
                        <a id="download-error-cut-aux"
                           th:data-url="@{/files/{user}/errorCutAux.xlsx(user=${session.user.account})}"
                           href="javascript:void(0);">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>选择工时Excel文件并上传</label>
                        <input class="btn" type="file" multiple="multiple" name="file">
                        <p class="help-block">请按模板格式进行导入，信息与模板信息对应。</p>
                        <input type="hidden" style="display: none" name="batId" th:value="${cost.batId}"/>
                        <input type="hidden" style="display: none" name="id" th:value="${cost.id}"/>
                        <input type="hidden" style="display: none" name="part" th:value="${cost.part}"/>
                        <input type="hidden" style="display: none" name="proCode" th:value="${project.code}"/>
                        <input type="hidden" style="display: none" name="major" th:value="${cost.major}"/>
                    </div>
                    <div class="form-group">
                        <label>选择辅材Excel文件并上传</label>
                        <input class="btn" type="file" multiple="multiple" name="file">
                        <p class="help-block">请按模板格式进行导入，信息与模板信息对应。</p>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-upload-cut" type="button" class="btn btn-success">
                    <span class="Bold">上传</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--包装工时导入-->
<div class="modal fade" id="modal-import-packing-hours">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">Excel信息导入</h4>
            </div>
            <div class="modal-body">
                <form id="importPackingHoursForm">
                    <div class="form-group">
                        <label>模版</label>
                        <a th:href="@{/file/包装工时模板.xlsx}">点击下载</a>
                    </div>

                    <div class="form-group">
                        <label>上次导入错误数据</label>
                        <a id="download-error-packing-hours"
                           th:data-url="@{/files/{user}/errorPackingHours.xlsx(user=${session.user.account})}"
                           href="javascript:void(0);">点击下载</a>
                    </div>

                    <div class="form-group">
                        <label>选择工时Excel文件并上传</label>
                        <input class="btn" type="file" multiple="multiple" name="file">
                        <p class="help-block">请按模板格式进行导入，信息与模板信息对应。</p>
                        <input type="hidden" style="display: none" name="batId" th:value="${cost.batId}"/>
                        <input type="hidden" style="display: none" name="id" th:value="${cost.id}"/>
                        <input type="hidden" style="display: none" name="part" th:value="${cost.part}"/>
                        <input type="hidden" style="display: none" name="proCode" th:value="${project.code}"/>
                        <input type="hidden" style="display: none" name="major" th:value="${cost.major}"/>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-upload-packing-hours" type="button" class="btn btn-success">
                    <span class="Bold">上传</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--包装辅材导入-->
<div class="modal fade" id="modal-import-packing-aux">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">Excel信息导入</h4>
            </div>
            <div class="modal-body">
                <form id="importPackingAuxForm">
                    <div class="form-group">
                        <label>模版</label>
                        <a th:href="@{/file/包装辅材模板.xlsx}">点击下载</a>
                    </div>

                    <div class="form-group">
                        <label>上次导入错误数据</label>
                        <a id="download-error-packing-aux"
                           th:data-url="@{/files/{user}/errorPackingAux.xlsx(user=${session.user.account})}"
                           href="javascript:void(0);">点击下载</a>
                    </div>

                    <div class="form-group">
                        <label>选择工时Excel文件并上传</label>
                        <input class="btn" type="file" multiple="multiple" name="file">
                        <p class="help-block">请按模板格式进行导入，信息与模板信息对应。</p>
                        <input type="hidden" style="display: none" name="batId" th:value="${cost.batId}"/>
                        <input type="hidden" style="display: none" name="id" th:value="${cost.id}"/>
                        <input type="hidden" style="display: none" name="part" th:value="${cost.part}"/>
                        <input type="hidden" style="display: none" name="proCode" th:value="${project.code}"/>
                        <input type="hidden" style="display: none" name="major" th:value="${cost.major}"/>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-upload-packing-aux" type="button" class="btn btn-success">
                    <span class="Bold">上传</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--铆焊导入-->
<div class="modal fade" id="modal-import-rivetAndSolder">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">Excel信息导入</h4>
            </div>
            <div class="modal-body">
                <form id="importRivetAndSolderForm">
                    <div class="form-group">
                        <label>工时模版</label>
                        <a th:href="@{/file/铆焊工时模板.xlsx}">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>辅材模版</label>
                        <a th:href="@{/file/铆焊辅材模板.xlsx}">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>工时上次导入错误数据</label>
                        <a id="download-error-RivetAndSolder-hours"
                           th:data-url="@{/files/{user}/errorRivetAndSolderHours.xlsx(user=${session.user.account})}"
                           href="javascript:void(0);">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>辅材上次导入错误数据</label>
                        <a id="download-error-RivetAndSolder-aux"
                           th:data-url="@{/files/{user}/erroRivetAndSolderAux.xlsx(user=${session.user.account})}"
                           href="javascript:void(0);">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>选择工时Excel文件并上传</label>
                        <input class="btn" type="file" multiple="multiple" name="file">
                        <p class="help-block">请按模板格式进行导入，信息与模板信息对应。</p>
                        <input type="hidden" style="display: none" name="batId" th:value="${cost.batId}"/>
                        <input type="hidden" style="display: none" name="id" th:value="${cost.id}"/>
                        <input type="hidden" style="display: none" name="part" th:value="${cost.part}"/>
                        <input type="hidden" style="display: none" name="proCode" th:value="${project.code}"/>
                        <input type="hidden" style="display: none" name="major" th:value="${cost.major}"/>
                    </div>
                    <div class="form-group">
                        <label>选择辅材Excel文件并上传</label>
                        <input class="btn" type="file" multiple="multiple" name="file">
                        <p class="help-block">请按模板格式进行导入，信息与模板信息对应。</p>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-upload-rivetAndSolder" type="button" class="btn btn-success">
                    <span class="Bold">上传</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--喷涂导入-->
<div class="modal fade" id="modal-import-spray">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">Excel信息导入</h4>
            </div>
            <div class="modal-body">
                <form id="importSprayForm">
                    <div class="form-group">
                        <label>工时模版</label>
                        <a th:href="@{/file/喷涂工时模板.xlsx}">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>辅材模版</label>
                        <a th:href="@{/file/喷涂辅材模板.xlsx}">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>工时上次导入错误数据</label>
                        <a id="download-error-spray-hours"
                           th:data-url="@{/files/{user}/errorSprayHours.xlsx(user=${session.user.account})}"
                           href="javascript:void(0);">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>辅材上次导入错误数据</label>
                        <a id="download-error-spray-aux"
                           th:data-url="@{/files/{user}/erroSprayAux.xlsx(user=${session.user.account})}"
                           href="javascript:void(0);">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>选择工时Excel文件并上传</label>
                        <input class="btn" type="file" multiple="multiple" name="file">
                        <p class="help-block">请按模板格式进行导入，信息与模板信息对应。</p>
                        <input type="hidden" style="display: none" name="batId" th:value="${cost.batId}"/>
                        <input type="hidden" style="display: none" name="id" th:value="${cost.id}"/>
                        <input type="hidden" style="display: none" name="part" th:value="${cost.part}"/>
                        <input type="hidden" style="display: none" name="proCode" th:value="${project.code}"/>
                        <input type="hidden" style="display: none" name="major" th:value="${cost.major}"/>
                    </div>
                    <div class="form-group">
                        <label>选择辅材Excel文件并上传</label>
                        <input class="btn" type="file" multiple="multiple" name="file">
                        <p class="help-block">请按模板格式进行导入，信息与模板信息对应。</p>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-upload-spray" type="button" class="btn btn-success">
                    <span class="Bold">上传</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--装配导入-->
<div class="modal fade" id="modal-import-assembly">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">Excel信息导入</h4>
            </div>
            <div class="modal-body">
                <form id="importAssemblyForm">
                    <div class="form-group">
                        <label>工时模版</label>
                        <a th:href="@{/file/装配工时模板.xlsx}">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>辅材模版</label>
                        <a th:href="@{/file/装配辅材模板.xlsx}">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>工时上次导入错误数据</label>
                        <a id="download-error-assembly-hours"
                           th:data-url="@{/files/{user}/errorAssemblyHours.xlsx(user=${session.user.account})}"
                           href="javascript:void(0);">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>辅材上次导入错误数据</label>
                        <a id="download-error-assembly-aux"
                           th:data-url="@{/files/{user}/erroAssemblyAux.xlsx(user=${session.user.account})}"
                           href="javascript:void(0);">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>选择工时Excel文件并上传</label>
                        <input class="btn" type="file" multiple="multiple" name="file">
                        <p class="help-block">请按模板格式进行导入，信息与模板信息对应。</p>
                        <input type="hidden" style="display: none" name="batId" th:value="${cost.batId}"/>
                        <input type="hidden" style="display: none" name="id" th:value="${cost.id}"/>
                        <input type="hidden" style="display: none" name="part" th:value="${cost.part}"/>
                        <input type="hidden" style="display: none" name="proCode" th:value="${project.code}"/>
                        <input type="hidden" style="display: none" name="major" th:value="${cost.major}"/>
                    </div>
                    <div class="form-group">
                        <label>选择辅材Excel文件并上传</label>
                        <input class="btn" type="file" multiple="multiple" name="file">
                        <p class="help-block">请按模板格式进行导入，信息与模板信息对应。</p>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-upload-assembly" type="button" class="btn btn-success">
                    <span class="Bold">上传</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--热处理导入-->
<div class="modal fade" id="modal-import-heatTreatment">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">Excel信息导入</h4>
            </div>
            <div class="modal-body">
                <form id="importheatTreatmentForm">
                    <div class="form-group">
                        <label>热处理模版</label>
                        <a th:href="@{/file/热处理模板.xlsx}">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>热处理上次导入错误数据</label>
                        <a id="download-error-heatTreatment"
                           th:data-url="@{/files/{user}/errorheatTreatment.xlsx(user=${session.user.account})}"
                           href="javascript:void(0);">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>选择热处理Excel文件并上传</label>
                        <input class="btn" type="file" multiple="multiple" name="file">
                        <p class="help-block">请按模板格式进行导入，信息与模板信息对应。</p>
                        <input type="hidden" style="display: none" name="batId" th:value="${cost.batId}"/>
                        <input type="hidden" style="display: none" name="id" th:value="${cost.id}"/>
                        <input type="hidden" style="display: none" name="part" th:value="${cost.part}"/>
                        <input type="hidden" style="display: none" name="proCode" th:value="${project.code}"/>
                        <input type="hidden" style="display: none" name="major" th:value="${cost.major}"/>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-upload-heatTreatment" type="button" class="btn btn-success">
                    <span class="Bold">上传</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--机加导入-->
<div class="modal fade" id="modal-import-mac">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">Excel信息导入</h4>
            </div>
            <div class="modal-body">
                <form id="importMacForm">
                    <div class="form-group">
                        <label>工时模版</label>
                        <a th:href="@{/file/机加工时模板.xlsx}">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>工时上次导入错误数据</label>
                        <a id="download-error-mac-hours"
                           th:data-url="@{/files/{user}/errorMacHours.xlsx(user=${session.user.account})}"
                           href="javascript:void(0);">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>选择工时Excel文件并上传</label>
                        <input class="btn" type="file" multiple="multiple" name="file">
                        <p class="help-block">请按模板格式进行导入，信息与模板信息对应。</p>
                        <input type="hidden" style="display: none" name="batId" th:value="${cost.batId}"/>
                        <input type="hidden" style="display: none" name="id" th:value="${cost.id}"/>
                        <input type="hidden" style="display: none" name="part" th:value="${cost.part}"/>
                        <input type="hidden" style="display: none" name="proCode" th:value="${project.code}"/>
                        <input type="hidden" style="display: none" name="major" th:value="${cost.major}"/>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-upload-mac" type="button" class="btn btn-success">
                    <span class="Bold">上传</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--添加原材料-->
<div class="modal fade" id="modal-mat-add">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">添加数据</h4>
            </div>
            <div class="modal-body">
                <form id="matAddForm" class="form-horizontal">
                    <input name="priceType" value="2" type="hidden" style="display:none"/>
                    <input name="costId" th:value="${cost.id}" type="hidden" style="display:none"/>
                    <input name="isPrototypeDataFlag" value="0" type="hidden" style="display:none"/>
                    <input name="isEffectiveFlag" value="1" type="hidden" style="display:none"/>
                    <input name="part" type="hidden" style="display:none" th:value="${cost.part}"/>
                    <input name="major" type="hidden" style="display:none" th:value="${cost.major}"/>
                    <input name="texture" type="hidden" style="display:none" th:value="${texture}"/>
                    <input name="batId" type="hidden" style="display:none" th:value="${cost.batId}"/>
                    <input name="buyType" type="hidden" style="display:none" value="原材料"/>
                    <div class="form-group">
                        <label class="control-label col-sm-3">部分</label>
                        <label id="part" class="control-label col-sm-7" style="text-align: left"
                               th:text="${cost.part}"></label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">专业</label>
                        <label id="major" class="control-label col-sm-7" style="text-align: left"
                               th:text="${cost.major}"></label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">提报计划物料描述</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="matDesc" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">材质</label>
                        <label id="texture" class="control-label col-sm-7" style="text-align: left"
                               th:text="${texture}"></label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">实用数量</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="num" maxlength="21"
                                   oninput="formatNumber(this)"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">单位</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="unit" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">备注</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="remark" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">SAP物料编码</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="sapCode" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">采购物料描述</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="buyMatDesc" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">单价</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="price" maxlength="21"
                                   oninput="formatNumber(this)"/>
                        </label>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-save-add" type="button" class="btn btn-success">
                    <span class="Bold">保存</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--添加下料 铆焊 喷涂 装配-->
<div class="modal fade" id="modal-cut-add">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">添加数据</h4>
            </div>
            <div class="modal-body">
                <ul id="modal-nav" class="nav nav-tabs" role="tablist">
                    <li id="li-hours" role="presentation" class="active">
                        <a href="#hours" role="tab" data-toggle="tab">工时信息</a>
                    </li>
                    <li id="li-aux" role="presentation">
                        <a href="#aux" role="tab" data-toggle="tab">辅材信息</a>
                    </li>
                </ul>
                <div class="tab-content">
                    <div role="tabpanel" class="tab-pane active" id="hours">
                        <form id="cutHoursAddForm" class="form-horizontal">
                            <input name="priceType" value="2" type="hidden" style="display:none"/>
                            <input name="proCode" th:value="${project.code}" type="hidden" style="display:none"/>
                            <input name="dataUseType" value="3" type="hidden" style="display:none"/>
                            <input name="costId" th:value="${cost.id}" type="hidden" style="display:none"/>
                            <input name="isPrototypeDataFlag" value="0" type="hidden" style="display:none"/>
                            <input name="isEffectiveFlag" value="1" type="hidden" style="display:none"/>
                            <input name="part" type="hidden" style="display:none" th:value="${cost.part}"/>
                            <input name="major" type="hidden" style="display:none" th:value="${cost.major}"/>
                            <input name="batId" type="hidden" style="display:none" th:value="${cost.batId}"/>
                            <input name="unit" value="工日" type="hidden" style="display:none"/>
                            <input name="dataType" value="工时" type="hidden" style="display:none"/>
                            <div class="form-group">
                                <label class="control-label col-sm-3">部分</label>
                                <label class="control-label col-sm-7" style="text-align: left"
                                       th:text="${cost.part}"></label>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-sm-3">专业</label>
                                <label class="control-label col-sm-7" style="text-align: left"
                                       th:text="${cost.major}"></label>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-sm-3">工时类别</label>
                                <label class="control-label col-sm-7">
                                    <input class="form-control" type="text" name="laborName" maxlength="255"/>
                                </label>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-sm-3">数量</label>
                                <label class="control-label col-sm-7">
                                    <input class="form-control" type="text" name="laborNum" maxlength="21"
                                           oninput="formatNumber(this)"/>
                                </label>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-sm-3">单位</label>
                                <label class="control-label col-sm-7" style="text-align: left">工日</label>
                            </div>
                            <div class="form-group" id="sprayTypeHours" style="display:none">
                                <label class="control-label col-sm-3">涂装类别：</label>
                                <label class="control-label col-sm-7" style="text-align: left">
                                    <select name="sprayType" class="form-control">
                                        <option value="喷砂处理">喷砂处理</option>
                                        <option value="涂装处理">涂装处理</option>
                                    </select>
                                </label>
                            </div>
                        </form>
                    </div>
                    <div role="tabpanel" class="tab-pane" id="aux">
                        <form id="cutAuxAddForm" class="form-horizontal">
                            <input name="priceType" value="2" type="hidden" style="display:none"/>
                            <input name="proCode" th:value="${project.code}" type="hidden" style="display:none"/>
                            <input name="dataUseType" value="3" type="hidden" style="display:none"/>
                            <input name="costId" th:value="${cost.id}" type="hidden" style="display:none"/>
                            <input name="isPrototypeDataFlag" value="0" type="hidden" style="display:none"/>
                            <input name="isEffectiveFlag" value="1" type="hidden" style="display:none"/>
                            <input name="part" type="hidden" style="display:none" th:value="${cost.part}"/>
                            <input name="major" type="hidden" style="display:none" th:value="${cost.major}"/>
                            <input name="batId" type="hidden" style="display:none" th:value="${cost.batId}"/>
                            <input name="dataType" value="辅材" type="hidden" style="display:none"/>
                            <div class="form-group">
                                <label class="control-label col-sm-3">部分</label>
                                <label class="control-label col-sm-7" style="text-align: left"
                                       th:text="${cost.part}"></label>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-sm-3">专业</label>
                                <label class="control-label col-sm-7" style="text-align: left"
                                       th:text="${cost.major}"></label>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-sm-3">主要辅材类别</label>
                                <label class="control-label col-sm-7">
                                    <input class="form-control" type="text" name="laborName" maxlength="255"/>
                                </label>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-sm-3">数量</label>
                                <label class="control-label col-sm-7">
                                    <input class="form-control" type="text" name="laborNum" maxlength="21"
                                           oninput="formatNumber(this)"/>
                                </label>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-sm-3">单位</label>
                                <label class="control-label col-sm-7">
                                    <input class="form-control" type="text" name="unit" maxlength="255"/>
                                </label>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-sm-3">单价</label>
                                <label class="control-label col-sm-7">
                                    <input class="form-control" type="text" name="price" maxlength="21"
                                           oninput="formatNumber(this)"/></label>
                            </div>
                            <div class="form-group" id="sprayTypeAux" style="display:none">
                                <label class="control-label col-sm-3">涂装类别：</label>
                                <label class="control-label col-sm-7" style="text-align: left">
                                    <select name="sprayType" class="form-control">
                                        <option value="喷砂处理">喷砂处理</option>
                                        <option value="涂装处理">涂装处理</option>
                                    </select>
                                </label>
                            </div>
                        </form>
                    </div>
                </div>
                <div class="modal-footer">
                    <button id="btn-save-add-cut" type="button" class="btn btn-success">
                        <span class="Bold">保存</span>
                    </button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                </div>
            </div>
        </div>
    </div>
</div>
<!--添加/编辑 现场安装-辅材-->
<div class="modal fade" id="modal-aux-add">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">添加数据</h4>
            </div>
            <div class="modal-body">
                <form id="auxAddForm" class="form-horizontal">
                    <input name="id" type="hidden" style="display:none"/>
                    <input name="priceType" value="2" type="hidden" style="display:none"/>
                    <input name="proCode" th:value="${project.code}" type="hidden" style="display:none"/>
                    <input name="dataUseType" value="3" type="hidden" style="display:none"/>
                    <input name="costId" th:value="${cost.id}" type="hidden" style="display:none"/>
                    <input name="isPrototypeDataFlag" value="0" type="hidden" style="display:none"/>
                    <input name="isEffectiveFlag" value="1" type="hidden" style="display:none"/>
                    <input name="part" type="hidden" style="display:none" th:value="${cost.part}"/>
                    <input name="major" type="hidden" style="display:none" th:value="${cost.major}"/>
                    <input name="batId" type="hidden" style="display:none" th:value="${cost.batId}"/>
                    <input name="dataType" value="辅材" type="hidden" style="display:none"/>
                    <div class="form-group">
                        <label class="control-label col-sm-3">部分</label>
                        <label class="control-label col-sm-7" style="text-align: left"
                               th:text="${cost.part}"></label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">专业</label>
                        <label class="control-label col-sm-7" style="text-align: left"
                               th:text="${cost.major}"></label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">主要辅材类别</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="laborName" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">数量</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="laborNum" maxlength="21"
                                   oninput="formatNumber(this)"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">单位</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="unit" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">单价</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="price" maxlength="21"
                                   oninput="formatNumber(this)"/></label>
                    </div>
                </form>
                <div class="modal-footer">
                    <button id="btn-save-add-aux" type="button" class="btn btn-success">
                        <span class="Bold">保存</span>
                    </button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                </div>
            </div>
        </div>
    </div>
</div>
<!--安装人工添加/编辑-->
<div class="modal fade" id="modal-install-add">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">安装人工编辑</h4>
            </div>
            <div class="modal-body">
                <div class="tab-content">
                    <form id="installHoursAddForm" class="form-horizontal">
                        <input name="id" value="" type="hidden" style="display:none"/>
                        <input name="priceType" value="2" type="hidden" style="display:none"/>
                        <input name="proCode" th:value="${project.code}" type="hidden" style="display:none"/>
                        <input name="dataUseType" value="3" type="hidden" style="display:none"/>
                        <input name="costId" th:value="${cost.id}" type="hidden" style="display:none"/>
                        <input name="isPrototypeDataFlag" value="0" type="hidden" style="display:none"/>
                        <input name="isEffectiveFlag" value="1" type="hidden" style="display:none"/>
                        <input name="part" type="hidden" style="display:none" th:value="${cost.part}"/>
                        <input name="major" type="hidden" style="display:none" th:value="${cost.major}"/>
                        <input name="batId" type="hidden" style="display:none" th:value="${cost.batId}"/>
                        <input name="unit" value="工日" type="hidden" style="display:none"/>
                        <input name="dataType" value="工时" type="hidden" style="display:none"/>
                        <div class="form-group">
                            <label class="control-label col-sm-3">部分</label>
                            <label class="control-label col-sm-7" style="text-align: left"
                                   th:text="${cost.part}"></label>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-sm-3">专业</label>
                            <label class="control-label col-sm-7" style="text-align: left"
                                   th:text="${cost.major}"></label>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-sm-3">工时类别</label>
                            <label class="control-label col-sm-7">
                                <input class="form-control" type="text" name="laborName" maxlength="255"/>
                            </label>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-sm-3">数量</label>
                            <label class="control-label col-sm-7">
                                <input class="form-control" type="text" name="laborNum" maxlength="21"
                                       oninput="formatNumber(this)"/>
                            </label>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-sm-3">单位</label>
                            <label class="control-label col-sm-7" style="text-align: left">工日</label>
                        </div>
                    </form>
                    <div class="modal-footer">
                        <button id="btn-save-add-install" type="button" class="btn btn-success">
                            <span class="Bold">保存</span>
                        </button>
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--包装运输费-包装费-工时 添加/编辑-->
<div class="modal fade" id="modal-packing-hours-add">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">包装费工时编辑</h4>
            </div>
            <div class="modal-body">
                <div class="tab-content">
                    <form id="packingHoursAddForm" class="form-horizontal">
                        <input name="id" value="" type="hidden" style="display:none"/>
                        <input name="priceType" value="2" type="hidden" style="display:none"/>
                        <input name="proCode" th:value="${project.code}" type="hidden" style="display:none"/>
                        <input name="dataUseType" value="3" type="hidden" style="display:none"/>
                        <input name="costId" th:value="${cost.id}" type="hidden" style="display:none"/>
                        <input name="isPrototypeDataFlag" value="0" type="hidden" style="display:none"/>
                        <input name="isEffectiveFlag" value="1" type="hidden" style="display:none"/>
                        <input name="part" type="hidden" style="display:none" th:value="${cost.part}"/>
                        <input name="major" type="hidden" style="display:none" th:value="${cost.major}"/>
                        <input name="batId" type="hidden" style="display:none" th:value="${cost.batId}"/>
                        <input name="unit" value="工日" type="hidden" style="display:none"/>
                        <input name="dataType" value="工时" type="hidden" style="display:none"/>
                        <div class="form-group">
                            <label class="control-label col-sm-3">工时类别</label>
                            <label class="control-label col-sm-7">
                                <input class="form-control" type="text" name="laborName" maxlength="255"/>
                            </label>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-sm-3">数量</label>
                            <label class="control-label col-sm-7">
                                <input class="form-control" type="text" name="laborNum" maxlength="21"
                                       oninput="formatNumber(this)"/>
                            </label>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-sm-3">单位</label>
                            <label class="control-label col-sm-7" style="text-align: left">工日</label>
                        </div>
                    </form>
                    <div class="modal-footer">
                        <button id="btn-save-add-packingHours" type="button" class="btn btn-success">
                            <span class="Bold">保存</span>
                        </button>
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--包装运输费-运输费 添加/编辑-->
<div class="modal fade" id="modal-transport-add">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">运输费编辑</h4>
            </div>
            <div class="modal-body">

                <form id="transportAddForm" class="form-horizontal">
                    <input name="id" value="" type="hidden" style="display:none"/>
                    <input name="priceType" value="2" type="hidden" style="display:none"/>
                    <input name="proCode" th:value="${project.code}" type="hidden" style="display:none"/>
                    <input name="dataUseType" value="3" type="hidden" style="display:none"/>
                    <input name="costId" th:value="${cost.id}" type="hidden" style="display:none"/>
                    <input name="isPrototypeDataFlag" value="0" type="hidden" style="display:none"/>
                    <input name="isEffectiveFlag" value="1" type="hidden" style="display:none"/>
                    <input name="part" type="hidden" style="display:none" th:value="${cost.part}"/>
                    <input name="major" type="hidden" style="display:none" th:value="${cost.major}"/>
                    <input name="batId" type="hidden" style="display:none" th:value="${cost.batId}"/>
                    <input name="dataType" value="运输费" type="hidden" style="display:none"/>
                    <div class="form-group">
                        <label class="control-label col-sm-3">发货地</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="placeDelivery" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">目的地</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="destination" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">重量</label>
                        <label class="col-sm-5">
                            <input class="form-control" type="text" name="laborNum" maxlength="21"
                                   oninput="formatNumber(this)"/>
                        </label>
                        <label class="control-label col-sm-2" style="text-align: left">&nbsp;&nbsp;&nbsp;&nbsp;吨&nbsp;&nbsp;&nbsp;&nbsp;</label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">车数</label>
                        <label class="col-sm-5">
                            <input class="form-control" type="text" name="carNum" maxlength="21"
                                   oninput="formatNumber(this)"/>
                        </label>
                        <label class="control-label col-sm-2" style="text-align: left">（车）</label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">距离</label>
                        <label class="col-sm-5">
                            <input class="form-control" type="text" name="distance" maxlength="21"
                                   oninput="formatNumber(this)"/>
                        </label>
                        <label class="control-label col-sm-2" style="text-align: left">（km）</label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">运费</label>
                        <label class="col-sm-5">
                            <input class="form-control" type="text" name="price" maxlength="21"
                                   oninput="formatNumber(this)"/>
                        </label>
                        <label class="control-label col-sm-2" style="text-align: left">（元）</label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">备注</label>
                        <label class="col-sm-7">
                            <input class="form-control" type="text" name="remark" maxlength="255"/>
                        </label>
                    </div>
                </form>
                <div class="modal-footer">
                    <button id="btn-save-add-transport" type="button" class="btn btn-success">
                        <span class="Bold">保存</span>
                    </button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                </div>
            </div>
        </div>
    </div>
</div>
<!--包装运输费-包装费-辅材 添加/编辑-->
<div class="modal fade" id="modal-packing-aux-add">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">包装费辅材编辑</h4>
            </div>
            <div class="modal-body">
                <div class="tab-content">
                    <form id="packingAuxAddForm" class="form-horizontal">
                        <input name="id" value="" type="hidden" style="display:none"/>
                        <input name="priceType" value="2" type="hidden" style="display:none"/>
                        <input name="proCode" th:value="${project.code}" type="hidden" style="display:none"/>
                        <input name="dataUseType" value="3" type="hidden" style="display:none"/>
                        <input name="costId" th:value="${cost.id}" type="hidden" style="display:none"/>
                        <input name="isPrototypeDataFlag" value="0" type="hidden" style="display:none"/>
                        <input name="isEffectiveFlag" value="1" type="hidden" style="display:none"/>
                        <input name="part" type="hidden" style="display:none" th:value="${cost.part}"/>
                        <input name="major" type="hidden" style="display:none" th:value="${cost.major}"/>
                        <input name="batId" type="hidden" style="display:none" th:value="${cost.batId}"/>
                        <input name="dataType" value="辅材" type="hidden" style="display:none"/>
                        <div class="form-group">
                            <label class="control-label col-sm-3">主要辅材类别</label>
                            <label class="control-label col-sm-7">
                                <input class="form-control" type="text" name="laborName" maxlength="255"/>
                            </label>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-sm-3">主要辅材用量</label>
                            <label class="control-label col-sm-7">
                                <input class="form-control" type="text" name="laborNum" maxlength="21"
                                       oninput="formatNumber(this)"/>
                            </label>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-sm-3">单位</label>
                            <label class="control-label col-sm-7">
                                <input class="form-control" type="text" name="unit" maxlength="255"/>
                            </label>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-sm-3">单价</label>
                            <label class="control-label col-sm-7">
                                <input class="form-control" type="text" name="price" maxlength="255"/>
                            </label>
                        </div>
                    </form>
                    <div class="modal-footer">
                        <button id="btn-save-add-packingAux" type="button" class="btn btn-success">
                            <span class="Bold">保存</span>
                        </button>
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--调试人工添加/编辑-->
<div class="modal fade" id="modal-debug-add">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">安装人工编辑</h4>
            </div>
            <div class="modal-body">
                <form id="debugHoursAddForm" class="form-horizontal">
                    <input name="id" type="hidden" style="display:none"/>
                    <input name="priceType" value="2" type="hidden" style="display:none"/>
                    <input name="proCode" th:value="${project.code}" type="hidden" style="display:none"/>
                    <input name="dataUseType" value="3" type="hidden" style="display:none"/>
                    <input name="costId" th:value="${cost.id}" type="hidden" style="display:none"/>
                    <input name="isPrototypeDataFlag" value="0" type="hidden" style="display:none"/>
                    <input name="isEffectiveFlag" value="1" type="hidden" style="display:none"/>
                    <input name="part" type="hidden" style="display:none" th:value="${cost.part}"/>
                    <input name="major" type="hidden" style="display:none" th:value="${cost.major}"/>
                    <input name="batId" type="hidden" style="display:none" th:value="${cost.batId}"/>
                    <input name="unit" value="工日" type="hidden" style="display:none"/>
                    <input name="dataType" value="工时" type="hidden" style="display:none"/>
                    <div class="form-group">
                        <label class="control-label col-sm-3">部分</label>
                        <label class="control-label col-sm-7" style="text-align: left"
                               th:text="${cost.part}"></label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">专业</label>
                        <label class="control-label col-sm-7" style="text-align: left"
                               th:text="${cost.major}"></label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">工时类别</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="laborName" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">数量</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="laborNum" maxlength="21"
                                   oninput="formatNumber(this)"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">单位</label>
                        <label class="control-label col-sm-7" style="text-align: left">工日</label>
                    </div>
                </form>
                <div class="modal-footer">
                    <button id="btn-save-add-debug" type="button" class="btn btn-success">
                        <span class="Bold">保存</span>
                    </button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                </div>
            </div>
        </div>
    </div>
</div>
<!--添加热处理-->
<div class="modal fade" id="modal-heatTreatment-add">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">添加数据</h4>
            </div>
            <div class="modal-body">
                <form id="heatTreatmentAddForm" class="form-horizontal">
                    <input name="priceType" value="2" type="hidden" style="display:none"/>
                    <input name="proCode" th:value="${project.code}" type="hidden" style="display:none"/>
                    <input name="dataUseType" value="3" type="hidden" style="display:none"/>
                    <input name="costId" th:value="${cost.id}" type="hidden" style="display:none"/>
                    <input name="isPrototypeDataFlag" value="0" type="hidden" style="display:none"/>
                    <input name="isEffectiveFlag" value="1" type="hidden" style="display:none"/>
                    <input name="part" type="hidden" style="display:none" th:value="${cost.part}"/>
                    <input name="major" type="hidden" style="display:none" th:value="${cost.major}"/>
                    <input name="batId" type="hidden" style="display:none" th:value="${cost.batId}"/>
                    <input name="dataType" value="重量" type="hidden" style="display:none"/>
                    <div class="form-group">
                        <label class="control-label col-sm-3">部分</label>
                        <label class="control-label col-sm-7" style="text-align: left"
                               th:text="${cost.part}"></label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">专业</label>
                        <label class="control-label col-sm-7" style="text-align: left"
                               th:text="${cost.major}"></label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">热处理形式</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="laborName" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">数量</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="laborNum" maxlength="21"
                                   oninput="formatNumber(this)"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">单位</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="unit" maxlength="255" value="KG"
                                   readonly="readonly"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">单价</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="price" oninput="formatNumber(this)"
                                   maxlength="255"/>
                        </label>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-save-add-heatTreatment" type="button" class="btn btn-success">
                    <span class="Bold">保存</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--添加外购费 备品备件 随机备件-->
<div class="modal fade" id="modal-pur-add">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">外购费编辑</h4>
            </div>
            <div class="modal-body">
                <form id="purAddForm" class="form-horizontal">
                    <input name="id" type="hidden" style="display:none"/>
                    <input name="priceType" value="2" type="hidden" style="display:none"/>
                    <input name="costId" th:value="${cost.id}" type="hidden" style="display:none"/>
                    <input name="isPrototypeDataFlag" value="0" type="hidden" style="display:none"/>
                    <input name="useType" value="3" type="hidden" style="display:none"/>
                    <input name="isEffectiveFlag" value="1" type="hidden" style="display:none"/>
                    <input name="part" type="hidden" style="display:none" th:value="${cost.part}"/>
                    <input name="major" th:if="${#strings.contains(cost.code,'外购费')}" type="hidden" style="display:none"
                           th:value="${cost.major}"/>
                    <input name="texture" type="hidden" style="display:none" th:value="${texture}"/>
                    <input name="batId" type="hidden" style="display:none" th:value="${cost.batId}"/>
                    <input name="proCode" type="hidden" style="display:none" th:value="${project.code}"/>
                    <input name="buyType" type="hidden" style="display:none" value="外购件"/>
                    <div class="form-group">
                        <label class="control-label col-sm-3">部分</label>
                        <label class="control-label col-sm-7" style="text-align: left"
                               th:text="${cost.part}"></label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">专业</label>
                        <label class="control-label col-sm-7" th:if="${#strings.contains(cost.code,'外购费')}"
                               style="text-align: left"
                               th:text="${cost.major}"></label>
                        <label class="control-label col-sm-7"
                               th:if="${#strings.contains(cost.code,'备品备件') or #strings.contains(cost.code,'随机备件')}">
                            <select name="major" class="form-control">
                                <option value="机械">机械</option>
                                <option value="流体">流体</option>
                                <option value="自动化">自动化</option>
                            </select>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">提报计划物料描述</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" list="matDescList" name="matDesc"
                                   maxlength="255"
                                   oninput="loadMatDescList()"/>
                            <datalist id="matDescList" onselect="clearItem(this)">

                            </datalist>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">实用数量</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="num" maxlength="21"
                                   oninput="formatNumber(this)"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">单位</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="unit" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">型号/标准号</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="standardNo" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">品牌</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="brand" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">备注</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="remark" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">SAP物料编码</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="sapCode" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">采购物料描述</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="buyMatDesc" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">单价</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="price" oninput="formatNumber(this)"
                                   maxlength="255"/>
                        </label>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-save-add-pur" type="button" class="btn btn-success">
                    <span class="Bold">保存</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--添加整体外协-->
<div class="modal fade" id="modal-whole-add">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">整体外协编辑</h4>
            </div>
            <div class="modal-body">
                <form id="wholeAddForm" class="form-horizontal">
                    <input name="id" type="hidden" style="display:none"/>
                    <input name="priceType" value="2" type="hidden" style="display:none"/>
                    <input name="costId" th:value="${cost.id}" type="hidden" style="display:none"/>
                    <input name="isPrototypeDataFlag" value="0" type="hidden" style="display:none"/>
                    <input name="useType" value="3" type="hidden" style="display:none"/>
                    <input name="isEffectiveFlag" value="1" type="hidden" style="display:none"/>
                    <input name="part" type="hidden" style="display:none" th:value="${cost.part}"/>
                    <input name="major" type="hidden" style="display:none" th:value="${cost.major}"/>
                    <input name="texture" type="hidden" style="display:none" th:value="${texture}"/>
                    <input name="batId" type="hidden" style="display:none" th:value="${cost.batId}"/>
                    <input name="proCode" type="hidden" style="display:none" th:value="${project.code}"/>
                    <input name="buyType" type="hidden" style="display:none" value="外购件"/>
                    <div class="form-group">
                        <label class="control-label col-sm-3">部分</label>
                        <label class="control-label col-sm-7" style="text-align: left"
                               th:text="${cost.part}"></label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">专业</label>
                        <label class="control-label col-sm-7" style="text-align: left"
                               th:text="${cost.major}"></label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">提报计划物料描述</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" list="matDescList" name="matDesc"
                                   maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">图号</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" list="matDescList" name="diagram"
                                   maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">实用数量</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="num" maxlength="21"
                                   oninput="formatNumber(this)"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">单位</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="unit" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">外协类型</label>
                        <label class="control-label col-sm-7">
                            <select name="assistType" class="form-control">
                                <option value="整体外协">整体外协</option>
                                <option value="铸件毛坯">铸件毛坯</option>
                                <option value="锻件毛坯">锻件毛坯</option>
                            </select>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">备注</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="remark" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">SAP物料编码</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="sapCode" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">采购物料描述</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="buyMatDesc" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">单价</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="price" oninput="formatNumber(this)"
                                   maxlength="255"/>
                        </label>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-save-add-whole" type="button" class="btn btn-success">
                    <span class="Bold">保存</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--添加带料外协-->
<div class="modal fade" id="modal-whithMat-add">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">带料外协编辑</h4>
            </div>
            <div class="modal-body">
                <form id="whithMatAddForm" class="form-horizontal">
                    <input name="id" type="hidden" style="display:none"/>
                    <input name="priceType" value="2" type="hidden" style="display:none"/>
                    <input name="costId" th:value="${cost.id}" type="hidden" style="display:none"/>
                    <input name="isPrototypeDataFlag" value="0" type="hidden" style="display:none"/>
                    <input name="useType" value="3" type="hidden" style="display:none"/>
                    <input name="isEffectiveFlag" value="1" type="hidden" style="display:none"/>
                    <input name="part" type="hidden" style="display:none" th:value="${cost.part}"/>
                    <input name="major" type="hidden" style="display:none" th:value="${cost.major}"/>
                    <input name="texture" type="hidden" style="display:none" th:value="${texture}"/>
                    <input name="batId" type="hidden" style="display:none" th:value="${cost.batId}"/>
                    <input name="proCode" type="hidden" style="display:none" th:value="${project.code}"/>
                    <input name="buyType" type="hidden" style="display:none" value="外购件"/>
                    <div class="form-group">
                        <label class="control-label col-sm-3">部分</label>
                        <label class="control-label col-sm-7" style="text-align: left"
                               th:text="${cost.part}"></label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">专业</label>
                        <label class="control-label col-sm-7" style="text-align: left"
                               th:text="${cost.major}"></label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">提报计划物料描述</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" list="matDescList" name="matDesc"
                                   maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">图号</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" list="matDescList" name="diagram"
                                   maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">实用数量</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="num" maxlength="21"
                                   oninput="formatNumber(this)"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">单位</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="unit" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">外协类型</label>
                        <label class="control-label col-sm-7">
                            <select name="assistType" class="form-control">
                                <option value="带料外协">带料外协</option>
                            </select>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">备注</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="remark" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">SAP物料编码</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="sapCode" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">采购物料描述</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="buyMatDesc" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">单价</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="price" oninput="formatNumber(this)"
                                   maxlength="255"/>
                        </label>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-save-add-whithMat" type="button" class="btn btn-success">
                    <span class="Bold">保存</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--编辑热处理-->
<div class="modal fade" id="modal-heatTreatment-edit">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">添加数据</h4>
            </div>
            <div class="modal-body">
                <form id="heatTreatmentEditForm" class="form-horizontal">
                    <input name="id" type="hidden" style="display:none"/>
                    <input name="priceType" value="2" type="hidden" style="display:none"/>
                    <input name="proCode" th:value="${project.code}" type="hidden" style="display:none"/>
                    <input name="dataUseType" value="3" type="hidden" style="display:none"/>
                    <input name="costId" th:value="${cost.id}" type="hidden" style="display:none"/>
                    <input name="isPrototypeDataFlag" value="0" type="hidden" style="display:none"/>
                    <input name="isEffectiveFlag" value="1" type="hidden" style="display:none"/>
                    <input name="part" type="hidden" style="display:none" th:value="${cost.part}"/>
                    <input name="major" type="hidden" style="display:none" th:value="${cost.major}"/>
                    <input name="batId" type="hidden" style="display:none" th:value="${cost.batId}"/>
                    <input name="dataType" value="重量" type="hidden" style="display:none"/>
                    <div class="form-group">
                        <label class="control-label col-sm-3">部分</label>
                        <label class="control-label col-sm-7" style="text-align: left"
                               th:text="${cost.part}"></label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">专业</label>
                        <label class="control-label col-sm-7" style="text-align: left"
                               th:text="${cost.major}"></label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">热处理形式</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="laborName" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">数量</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="laborNum" maxlength="21"
                                   oninput="formatNumber(this)"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">单位</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="unit" value="KG" maxlength="255"
                                   readonly="readonly"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">单价</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="price" oninput="formatNumber(this)"
                                   maxlength="255"/>
                        </label>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-save-edit-heatTreatment" type="button" class="btn btn-success">
                    <span class="Bold">保存</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--编辑喷涂-->
<div class="modal fade" id="modal-spray-edit">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">编辑数据</h4>
            </div>
            <div class="modal-body">
                <ul id="modal-nav-spray" class="nav nav-tabs" role="tablist">
                    <li id="li-hour-sprays" role="presentation" class="active">
                        <a href="#hoursSpray" role="tab" data-toggle="tab">工时信息</a>
                    </li>
                    <li id="li-aux-spray" role="presentation">
                        <a href="#auxSpray" role="tab" data-toggle="tab">辅材信息</a>
                    </li>
                </ul>
                <div class="tab-content">
                    <div role="tabpanel" class="tab-pane active" id="hoursSpray">
                        <form id="sprayHoursEditForm" class="form-horizontal">
                            <input name="id" type="hidden" style="display:none"/>
                            <input name="priceType" value="2" type="hidden" style="display:none"/>
                            <input name="proCode" th:value="${project.code}" type="hidden" style="display:none"/>
                            <input name="dataUseType" value="3" type="hidden" style="display:none"/>
                            <input name="costId" th:value="${cost.id}" type="hidden" style="display:none"/>
                            <input name="isPrototypeDataFlag" value="0" type="hidden" style="display:none"/>
                            <input name="isEffectiveFlag" value="1" type="hidden" style="display:none"/>
                            <input name="part" type="hidden" style="display:none" th:value="${cost.part}"/>
                            <input name="major" type="hidden" style="display:none" th:value="${cost.major}"/>
                            <input name="batId" type="hidden" style="display:none" th:value="${cost.batId}"/>
                            <input name="unit" value="工日" type="hidden" style="display:none"/>
                            <input name="dataType" value="工时" type="hidden" style="display:none"/>
                            <div class="form-group">
                                <label class="control-label col-sm-3">部分</label>
                                <label class="control-label col-sm-7" style="text-align: left"
                                       th:text="${cost.part}"></label>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-sm-3">专业</label>
                                <label class="control-label col-sm-7" style="text-align: left"
                                       th:text="${cost.major}"></label>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-sm-3">工时类别</label>
                                <label class="control-label col-sm-7">
                                    <input class="form-control" type="text" name="laborName" maxlength="255"/>
                                </label>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-sm-3">数量</label>
                                <label class="control-label col-sm-7">
                                    <input class="form-control" type="text" name="laborNum" maxlength="21"
                                           oninput="formatNumber(this)"/>
                                </label>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-sm-3">单位</label>
                                <label class="control-label col-sm-7" style="text-align: left">工日</label>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-sm-3">涂装类别：</label>
                                <label class="control-label col-sm-7" style="text-align: left">
                                    <select name="sprayType" class="form-control">
                                        <option value="喷砂处理">喷砂处理</option>
                                        <option value="涂装处理">涂装处理</option>
                                    </select>
                                </label>
                            </div>
                        </form>
                    </div>
                    <div role="tabpanel" class="tab-pane" id="auxSpray">
                        <form id="sprayAuxEditForm" class="form-horizontal">
                            <input name="id" type="hidden" style="display:none"/>
                            <input name="priceType" value="2" type="hidden" style="display:none"/>
                            <input name="proCode" th:value="${project.code}" type="hidden" style="display:none"/>
                            <input name="dataUseType" value="3" type="hidden" style="display:none"/>
                            <input name="costId" th:value="${cost.id}" type="hidden" style="display:none"/>
                            <input name="isPrototypeDataFlag" value="0" type="hidden" style="display:none"/>
                            <input name="isEffectiveFlag" value="1" type="hidden" style="display:none"/>
                            <input name="part" type="hidden" style="display:none" th:value="${cost.part}"/>
                            <input name="major" type="hidden" style="display:none" th:value="${cost.major}"/>
                            <input name="batId" type="hidden" style="display:none" th:value="${cost.batId}"/>
                            <input name="dataType" value="辅材" type="hidden" style="display:none"/>
                            <div class="form-group">
                                <label class="control-label col-sm-3">部分</label>
                                <label class="control-label col-sm-7" style="text-align: left"
                                       th:text="${cost.part}"></label>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-sm-3">专业</label>
                                <label class="control-label col-sm-7" style="text-align: left"
                                       th:text="${cost.major}"></label>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-sm-3">主要辅材类别</label>
                                <label class="control-label col-sm-7">
                                    <input class="form-control" type="text" name="laborName" maxlength="255"/>
                                </label>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-sm-3">数量</label>
                                <label class="control-label col-sm-7">
                                    <input class="form-control" type="text" name="laborNum" maxlength="21"
                                           oninput="formatNumber(this)"/>
                                </label>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-sm-3">单位</label>
                                <label class="control-label col-sm-7">
                                    <input class="form-control" type="text" name="unit" maxlength="255"/>
                                </label>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-sm-3">单价</label>
                                <label class="control-label col-sm-7">
                                    <input class="form-control" type="text" name="price" maxlength="21"
                                           oninput="formatNumber(this)"/></label>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-sm-3">涂装类别：</label>
                                <label class="control-label col-sm-7" style="text-align: left">
                                    <select name="sprayType" class="form-control">
                                        <option value="喷砂处理">喷砂处理</option>
                                        <option value="涂装处理">涂装处理</option>
                                    </select>
                                </label>
                            </div>
                        </form>
                    </div>
                </div>
                <div class="modal-footer">
                    <button id="btn-save-edit-spray" type="button" class="btn btn-success">
                        <span class="Bold">保存</span>
                    </button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                </div>
            </div>
        </div>
    </div>
</div>
<!--添加机加-->
<div class="modal fade" id="modal-mac-add">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">添加数据</h4>
            </div>
            <div class="modal-body">
                <form id="macHoursAddForm" class="form-horizontal">
                    <input name="id" type="hidden" style="display:none"/>
                    <input name="priceType" value="2" type="hidden" style="display:none"/>
                    <input name="proCode" th:value="${project.code}" type="hidden" style="display:none"/>
                    <input name="dataUseType" value="3" type="hidden" style="display:none"/>
                    <input name="costId" th:value="${cost.id}" type="hidden" style="display:none"/>
                    <input name="isPrototypeDataFlag" value="0" type="hidden" style="display:none"/>
                    <input name="isEffectiveFlag" value="1" type="hidden" style="display:none"/>
                    <input name="part" type="hidden" style="display:none" th:value="${cost.part}"/>
                    <input name="major" type="hidden" style="display:none" th:value="${cost.major}"/>
                    <input name="batId" type="hidden" style="display:none" th:value="${cost.batId}"/>
                    <input name="type" type="hidden" style="display:none" value="2"/>
                    <input name="dataType" value="工时" type="hidden" style="display:none"/>
                    <div class="form-group">
                        <label class="control-label col-sm-3">部分：</label>
                        <label class="control-label col-sm-7" style="text-align: left"
                               th:text="${cost.part}"></label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">专业：</label>
                        <label class="control-label col-sm-7" style="text-align: left"
                               th:text="${cost.major}"></label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">图号：</label>
                        <label class="col-sm-7">
                            <input class="form-control" type="text" name="diagram" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">图纸名称：</label>
                        <label class="col-sm-7">
                            <input class="form-control" type="text" name="drawingNo" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">数量：</label>
                        <label class="col-sm-7">
                            <input class="form-control" type="text" name="num" maxlength="21"
                                   oninput="formatNumber(this)"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">工序：</label>
                        <label class="col-sm-7">
                            <select class="form-control" name="process">

                            </select>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">设备类型：</label>
                        <label class="col-sm-7">
                            <select onchange="loadNameList()" class="form-control col-sm-7" name="nameType">

                            </select>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">设备型号/名称：</label>
                        <label class="col-sm-7">
                            <select class="form-control col-sm-7" name="name">

                            </select>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">工时（小时）：</label>
                        <label class="col-sm-3">
                            <input class="form-control"
                                   oninput="intValidator(event)"
                                   type="number"
                                   min="0"
                                   max="210000000"
                                   name="workHoursStr"
                                   step="0"
                                   value="0"
                                   onmousewheel="changeNumberVal(obj)"/>
                        </label>
                        <label class="control-label col-sm-3">工时（分钟）：</label>
                        <label class="col-sm-3">
                            <input class="form-control"
                                   oninput="intValidator2(event)"
                                   type="number"
                                   min="0"
                                   max="210000000"
                                   name="workMinuteStr"
                                   step="0"
                                   value="0"
                                   onmousewheel="changeNumberVal(obj)"/>
                        </label>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-save-mac-hours" type="button" class="btn btn-success">
                    <span class="Bold">保存</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--编辑机加-->
<div class="modal fade" id="modal-mac-edit">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">添加数据</h4>
            </div>
            <div class="modal-body">
                <form id="macHoursEditForm" class="form-horizontal">
                    <input name="id" type="hidden" style="display:none"/>
                    <input name="priceType" value="2" type="hidden" style="display:none"/>
                    <input name="proCode" th:value="${project.code}" type="hidden" style="display:none"/>
                    <input name="dataUseType" value="3" type="hidden" style="display:none"/>
                    <input name="costId" th:value="${cost.id}" type="hidden" style="display:none"/>
                    <input name="isPrototypeDataFlag" value="0" type="hidden" style="display:none"/>
                    <input name="isEffectiveFlag" value="1" type="hidden" style="display:none"/>
                    <input name="part" type="hidden" style="display:none" th:value="${cost.part}"/>
                    <input name="major" type="hidden" style="display:none" th:value="${cost.major}"/>
                    <input name="batId" type="hidden" style="display:none" th:value="${cost.batId}"/>
                    <input name="type" type="hidden" style="display:none" value="2"/>
                    <input name="dataType" value="工时" type="hidden" style="display:none"/>
                    <div class="form-group">
                        <label class="control-label col-sm-3">部分：</label>
                        <label class="control-label col-sm-7" style="text-align: left"
                               th:text="${cost.part}"></label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">专业：</label>
                        <label class="control-label col-sm-7" style="text-align: left"
                               th:text="${cost.major}"></label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">图号：</label>
                        <label class="col-sm-7">
                            <input class="form-control" type="text" name="diagram" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">图纸名称：</label>
                        <label class="col-sm-7">
                            <input class="form-control" type="text" name="drawingNo" maxlength="255"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">数量：</label>
                        <label class="col-sm-7">
                            <input class="form-control" type="text" name="num" maxlength="21"
                                   oninput="formatNumber(this)"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">工序：</label>
                        <label class="col-sm-7">
                            <select class="form-control" name="process">

                            </select>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">设备类型：</label>
                        <label class="col-sm-7">
                            <select onchange="loadNameList()" class="form-control col-sm-7" name="nameType">

                            </select>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">设备型号/名称：</label>
                        <label class="col-sm-7">
                            <select class="form-control col-sm-7" name="name">

                            </select>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">工时（小时）：</label>
                        <label class="col-sm-3">
                            <input class="form-control"
                                   oninput="intValidator(event)"
                                   type="number"
                                   min="0"
                                   max="210000000"
                                   name="workHoursStr"
                                   step="0"
                                   value="0"
                                   onmousewheel="changeNumberVal(obj)"/>
                        </label>
                        <label class="control-label col-sm-3">工时（分钟）：</label>
                        <label class="col-sm-3">
                            <input class="form-control"
                                   oninput="intValidator2(event)"
                                   type="number"
                                   min="0"
                                   max="210000000"
                                   name="workMinuteStr"
                                   step="0"
                                   value="0"
                                   onmousewheel="changeNumberVal(obj)"/>
                        </label>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-save-edit-mac-hours" type="button" class="btn btn-success">
                    <span class="Bold">保存</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--编辑设计工时-->
<div class="modal fade" id="modal-dsn-hours-add">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">编辑设计工时</h4>
            </div>
            <div class="modal-body">
                <form id="dsnHoursAddForm" class="form-horizontal">
                    <input name="id" type="hidden" style="display:none"/>
                    <input name="priceType" value="2" type="hidden" style="display:none"/>
                    <input name="proCode" th:value="${project.code}" type="hidden" style="display:none"/>
                    <input name="dataUseType" value="3" type="hidden" style="display:none"/>
                    <input name="costId" th:value="${cost.id}" type="hidden" style="display:none"/>
                    <input name="isPrototypeDataFlag" value="0" type="hidden" style="display:none"/>
                    <input name="isEffectiveFlag" value="1" type="hidden" style="display:none"/>
                    <input name="part" type="hidden" style="display:none" th:value="${cost.part}"/>
                    <input name="major" type="hidden" style="display:none" th:value="${cost.major}"/>
                    <input name="batId" type="hidden" style="display:none" th:value="${cost.batId}"/>
                    <input name="unit" value="工日" type="hidden" style="display:none"/>
                    <input name="dataType" value="工时" type="hidden" style="display:none"/>
                    <input name="laborName" value="设计工时" type="hidden" style="display:none"/>
                    <div class="form-group">
                        <label class="control-label col-sm-3">部分</label>
                        <label class="control-label col-sm-7" style="text-align: left"
                               th:text="${cost.part}"></label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">专业</label>
                        <label class="control-label col-sm-7" style="text-align: left"
                               th:text="${cost.major}"></label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">工时类别</label>
                        <label class="control-label col-sm-7" style="text-align: left">
                            设计工时
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">数量</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="laborNum" maxlength="21"
                                   oninput="formatNumber(this)"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">单位</label>
                        <label class="control-label col-sm-7" style="text-align: left">工日</label>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-save-dsn-hours" type="button" class="btn btn-success">
                    <span class="Bold">保存</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--编辑设计重量-->
<div class="modal fade" id="modal-dsn-weight-add">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">编辑设计重量</h4>
            </div>
            <div class="modal-body">
                <form id="dsnWeightAddForm" class="form-horizontal">
                    <input name="id" type="hidden" style="display:none"/>
                    <input name="priceType" value="2" type="hidden" style="display:none"/>
                    <input name="proCode" th:value="${project.code}" type="hidden" style="display:none"/>
                    <input name="dataUseType" value="3" type="hidden" style="display:none"/>
                    <input name="costId" th:value="${cost.id}" type="hidden" style="display:none"/>
                    <input name="isPrototypeDataFlag" value="0" type="hidden" style="display:none"/>
                    <input name="isEffectiveFlag" value="1" type="hidden" style="display:none"/>
                    <input name="part" type="hidden" style="display:none" th:value="${cost.part}"/>
                    <input name="major" type="hidden" style="display:none" th:value="${cost.major}"/>
                    <input name="batId" type="hidden" style="display:none" th:value="${cost.batId}"/>
                    <input name="unit" value="吨" type="hidden" style="display:none"/>
                    <input name="dataType" value="重量" type="hidden" style="display:none"/>
                    <div class="form-group">
                        <label class="control-label col-sm-3">部分</label>
                        <label class="control-label col-sm-7" style="text-align: left"
                               th:text="${cost.part}"></label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">专业</label>
                        <label class="control-label col-sm-7" style="text-align: left"
                               th:text="${cost.major}"></label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">设计重量类别</label>
                        <label class="control-label col-sm-7" style="text-align: left">
                            <select name="laborName" class="form-control">
                                <option value="结构总重">结构总重</option>
                                <option value="结构净重-碳钢">结构净重-碳钢</option>
                                <option value="结构净重-不锈钢">结构净重-不锈钢</option>
                                <option value="结构净重-铝材">结构净重-铝材</option>
                                <option value="结构净重-其他">结构净重-其他</option>
                            </select>
                            <input name="laborType" value="3" type="hidden" style="display:none"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">设计重量</label>
                        <label class="control-label col-sm-7">
                            <input class="form-control" type="text" name="laborNum" maxlength="21"
                                   oninput="formatNumber(this)"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">单位</label>
                        <label class="control-label col-sm-7" style="text-align: left">吨</label>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-save-dsn-weight" type="button" class="btn btn-success">
                    <span class="Bold">保存</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--设计工时导入-->
<div class="modal fade" id="modal-import-design-hours">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">Excel信息导入</h4>
            </div>
            <div class="modal-body">
                <form id="importDesignHoursForm">
                    <div class="form-group">
                        <label>模版</label>
                        <a id="a-xlsxTemplate-designHours" th:href="@{/file/设计工时模板.xlsx}">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>上次导入错误数据</label>
                        <a id="download-error-designHours"
                           th:data-url="@{/files/{user}/errorDesignHours.xlsx(user=${session.user.account})}"
                           href="javascript:void(0);">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>选择Excel文件并上传</label>
                        <input class="btn" type="file" multiple="multiple" name="file">
                        <p class="help-block">请按模板格式进行导入，信息与模板信息对应。</p>
                        <input type="hidden" style="display: none" name="batId" th:value="${cost.batId}"/>
                        <input type="hidden" style="display: none" name="id" th:value="${cost.id}"/>
                        <input type="hidden" style="display: none" name="part" th:value="${cost.part}"/>
                        <input type="hidden" style="display: none" name="costId" th:value="${cost.id}"/>
                        <input type="hidden" style="display: none" name="proCode" th:value="${project.code}"/>
                        <input type="hidden" style="display: none" name="major" th:value="${cost.major}"/>
                        <input type="hidden" style="display: none" name="priceType" value="2"/>
                        <input type="hidden" style="display: none" name="isEffectiveFlag" value="1"/>
                        <input type="hidden" style="display: none" name="isPrototypeDataFlag" value="0"/>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-upload-designHours" type="button" class="btn btn-success">
                    <span class="Bold">上传</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--设计重量导入-->
<div class="modal fade" id="modal-import-design-weight">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">Excel信息导入</h4>
            </div>
            <div class="modal-body">
                <form id="importDesignWeightForm">
                    <div class="form-group">
                        <label>模版</label>
                        <a id="a-xlsxTemplate-designWeight" th:href="@{/file/设计重量模板.xlsx}">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>上次导入错误数据</label>
                        <a id="download-error-designWeight"
                           th:data-url="@{/files/{user}/errorDesignWeight.xlsx(user=${session.user.account})}"
                           href="javascript:void(0);">点击下载</a>
                    </div>
                    <div class="form-group">
                        <label>选择Excel文件并上传</label>
                        <input class="btn" type="file" multiple="multiple" name="file">
                        <p class="help-block">请按模板格式进行导入，信息与模板信息对应。</p>
                        <input type="hidden" style="display: none" name="batId" th:value="${cost.batId}"/>
                        <input type="hidden" style="display: none" name="id" th:value="${cost.id}"/>
                        <input type="hidden" style="display: none" name="part" th:value="${cost.part}"/>
                        <input type="hidden" style="display: none" name="costId" th:value="${cost.id}"/>
                        <input type="hidden" style="display: none" name="proCode" th:value="${project.code}"/>
                        <input type="hidden" style="display: none" name="major" th:value="${cost.major}"/>
                        <input type="hidden" style="display: none" name="priceType" value="2"/>
                        <input type="hidden" style="display: none" name="isEffectiveFlag" value="1"/>
                        <input type="hidden" style="display: none" name="isPrototypeDataFlag" value="0"/>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-upload-designWeight" type="button" class="btn btn-success">
                    <span class="Bold">上传</span>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<section class="content-header">
    <h1 style="display: inline-block" th:text="${cost.code}"></h1>
</section>
<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header">
                    <div class="row">
                        <div class="form-inline" style="border-bottom: 3px #D2D6DE solid;">
                            <div class="form-group">
                                <label class="control-label">
                                    项目编号：
                                </label>
                                <label class="control-label" th:text="${project.code}"></label>
                                <input id="code" type="hidden" th:value="${project.code}" style="display: none">
                            </div>
                            <div class="form-group">
                                <label class="control-label">
                                    项目名称：
                                </label>
                                <label class="control-label" th:text="${project.name}"></label>
                            </div>
                            <div class="form-group">
                                <label class="control-label">
                                    需方：
                                </label>
                                <label class="control-label" th:text="${project.demander}"></label>
                            </div>
                            <div class="form-group">
                                <label class="control-label">
                                    安装地点：
                                </label>
                                <label class="control-label" th:text="${project.address}"></label>
                            </div>
                            <div class="form-group">
                                <label class="control-label">
                                    项目数量：
                                </label>
                                <label class="control-label" th:text="${project.num}"></label>
                            </div>
                            <div class="form-group">
                                <label class="control-label">
                                    设计类别：
                                </label>
                                <label class="control-label"
                                       th:text="${project.projectClassify == 1 ? '设计':'非设计'}"></label>
                            </div>
                            <div class="form-group pull-right" th:if="${mode} == 'edit'">
                                <label id="finishStatus" th:if="${cost.finishStatus eq 1}"
                                       class="badge label-default">未完结</label>
                                <label id="finishStatus" th:if="${cost.finishStatus eq 2}"
                                       class="badge label-warning">执行中</label>
                                <label id="finishStatus" th:if="${cost.finishStatus eq 3}"
                                       class="badge label-success">完结</label>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12">
                        <form id="queryForm" class="form-horizontal"
                              th:style="${#strings.contains(cost.code,'-材料费-材料采购费-') or #strings.contains(cost.code,'-外购费') or #strings.contains(cost.code,'-外协费') or #strings.contains(cost.code,'-备品备件') or #strings.contains(cost.code,'-随机备件')}?'':'display:none'">
                            <input type="hidden" style="display: none" name="finishStatus"
                                   th:value="${cost.finishStatus}"/>
                            <input type="hidden" style="display: none" name="batId" th:value="${cost.batId}"/>
                            <input type="hidden" style="display: none" name="id" th:value="${cost.id}"/>
                            <input type="hidden" style="display: none" name="costId" th:value="${cost.id}"/>
                            <input type="hidden" style="display: none" name="part" th:value="${cost.part}"/>
                            <input type="hidden" style="display: none" name="proCode" th:value="${project.code}"/>
                            <input type="hidden" style="display: none" name="major" th:value="${cost.major}"/>
                            <input type="hidden" style="display: none" id="mode" th:value="${mode}"/>
                            <input type="hidden" style="display: none" name="isEffectiveFlag"/>
                            <input type="hidden" style="display: none" name="costCode" th:value="${cost.code}"/>
                            <input type="hidden" style="display: none" name="costParentCode"
                                   th:value="${cost.parentCode}"/>
                            <div class="row">
                                <div class="form-inline">
                                    <div class="form-group" style="padding-right: 10px;">
                                        <label class="control-label">
                                            提报计划物料描述：
                                        </label>
                                        <label class="control-label">
                                            <input name="matDesc" class="form-control" type="text"/>
                                        </label>
                                    </div>
                                    <div class="form-group" style="padding-right: 10px;">
                                        <label class="control-label">
                                            金额来源：
                                        </label>
                                        <label class="control-label">
                                            <select name="priceType" class="form-control">
                                                <option value="">请选择</option>
                                                <option value="1">系统获取</option>
                                                <option value="2">人工编辑</option>
                                            </select>
                                        </label>
                                    </div>
                                    <div class="form-group pull-right">
                                        <label class="control-label">
                                            <button id="btn-search" style="margin-top: 4px" type="button"
                                                    class="btn btn-success">搜索
                                            </button>
                                        </label>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <div id="toolBar">
                    <div class="col-md-12">
                        <button id="btn-effective-batches" class="btn btn-success">批量有效</button>
                        <button id="btn-invalid-batches"
                                style="border-color: #985f0d;
                                    border-top-color: rgb(152, 95, 13);
                                    border-right-color: rgb(152, 95, 13);
                                    border-bottom-color: rgb(152, 95, 13);
                                    border-left-color: rgb(152, 95, 13)"
                                class="btn bg-orange">批量无效
                        </button>
                        <button id="btn-remove-batches" class="btn btn-danger">批量删除</button>
                        <button id="btn-clear" class="btn btn-danger">清空数据</button>
                        <button id="btn-prototype-export" class="btn btn-warning">样机导出</button>
                        <button id="btn-valid-data-import" class="btn btn-success">数据导入</button>
                        <button id="btn-add" class="btn btn-success">添加数据</button>
                        <label class="control-label">
                            数据模式：
                        </label>
                        <label class="control-label">
                            <select class="form-control" id="select-dataMode"
                                    style="background:#777777;border-color: #008d4c;
                                                border-top-color: rgb(0, 141, 76);
                                                border-right-color: rgb(0, 141, 76);
                                                border-bottom-color: rgb(0, 141, 76);
                                                border-left-color: rgb(0, 141, 76);
                                                color:#FFFFFF;border-radius: 5px;">
                                <option style="background:#777777;border-color: #008d4c;
                                                border-top-color: rgb(0, 141, 76);
                                                border-right-color: rgb(0, 141, 76);
                                                border-bottom-color: rgb(0, 141, 76);
                                                border-left-color: rgb(0, 141, 76);
                                                color:#FFFFFF;" value="0">全部
                                </option>
                                <option style="background:#00a65a;border-color: #008d4c;
                                                border-top-color: rgb(0, 141, 76);
                                                border-right-color: rgb(0, 141, 76);
                                                border-bottom-color: rgb(0, 141, 76);
                                                border-left-color: rgb(0, 141, 76);
                                                color:#FFFFFF;" value="1">有效数据
                                </option>
                                <option style="background:#ff851b;border-color: #985f0d;border-top-color: rgb(152, 95, 13);border-right-color: rgb(152, 95, 13);border-bottom-color: rgb(152, 95, 13);border-left-color: rgb(152, 95, 13);color:#FFFFFF;"
                                        value="2">无效数据
                                </option>
                            </select>
                        </label>
                        <!--                        <label id="macToolLabel1" class="control-label" style="display: none">-->
                        <!--                            机加工时换算工具：-->
                        <!--                        </label>-->
                        <!--                        <label id="macToolLabel2" class="control-label" style="display: none">-->
                        <!--                            机加工时：-->
                        <!--                        </label>-->
                        <!--                        <label id="macToolLabel3" class="control-label" style="display: none;width:60px;">-->
                        <!--                            <input id="macHours" class="form-control" oninput="formatNumber(this)" maxlength="255" style="text-align: right" />-->
                        <!--                        </label>-->
                        <!--                        <label id="macToolLabel4" class="control-label" style="display: none">-->
                        <!--                            ÷-->
                        <!--                        </label>-->
                        <!--                        <label id="macToolLabel5" class="control-label" style="display: none">-->
                        <!--                            核算项目数：-->
                        <!--                        </label>-->
                        <!--                        <label id="macToolLabel6" class="control-label" style="display: none;width:60px;">-->
                        <!--                            <input id="accCount" class="form-control" oninput="formatNumber(this)" maxlength="255" style="text-align: right"/>-->
                        <!--                        </label>-->
                        <!--                        <label id="macToolLabel7" class="control-label" style="display: none">-->
                        <!--                            ×-->
                        <!--                        </label>-->
                        <!--                        <label id="macToolLabel8" class="control-label" style="display: none">-->
                        <!--                            概算项目数：-->
                        <!--                        </label>-->
                        <!--                        <label id="macToolLabel9" class="control-label" style="display: none;width:60px;">-->
                        <!--                            <input id="estCount" class="form-control" oninput="formatNumber(this)" maxlength="255" style="text-align: right"/>-->
                        <!--                        </label>-->
                        <!--                        <label id="macToolLabel10" class="control-label" style="display: none">-->
                        <!--                            <button onclick="getResultMacHours()" class="btn btn-success btn-xs" ><b>=</b></button>-->
                        <!--                        </label>-->
                        <!--                        <label id="macToolLabel11" class="control-label" style="display: none">-->
                        <!--                            计算结果：-->
                        <!--                        </label>-->
                        <!--                        <label id="macToolLabel12" class="control-label" style="display: none;width:60px;">-->
                        <!--                            <input id="resultMacHours" class="form-control"  readonly="readonly" maxlength="255" style="text-align: right"/>-->
                        <!--                        </label>-->
                    </div>
                    <!--                        <button th:if="${mode=='edit'}" shiro:hasPermission="rou:adjust:edit" id="btn-calculationFinish"-->
                    <!--                                th:if="${cost.finishStatus != null && (cost.finishStatus eq 1 || cost.finishStatus eq 2)}"-->
                    <!--                                class="btn btn-success">自动计算并完结-->
                    <!--                        </button>-->
                    <!--                        <button th:if="${mode=='edit'}" shiro:hasPermission="rou:adjust:edit" id="btn-cancelFinish"-->
                    <!--                                th:if="${cost.finishStatus != null && cost.finishStatus eq 3}"-->
                    <!--                                class="btn btn-warning">取消完结-->
                    <!--                        </button>-->
                    <div class="col-md-12">
                        <label id="lbl-tax1" class="control-label">
                            税率：
                        </label>
                        <label id="lbl-tax2" class="control-label">
                            <input id="input_tax" readonly="readonly"
                                   style="display: inline-block;
                                   border: none;
                                   box-shadow: 2px 2px 5px #343434 inset;
                                   border-radius: 5px;
                                   outline:none;
                                   text-align: center;
                                   line-height: 36px;"
                                   type="text" maxlength="255"/>
                        </label>
                        <label id="lbl_avg_mac1" class="control-label"
                               th:if="${#strings.contains(cost.code,'制造费') or #strings.contains(cost.code,'包装运输费-包装费')}">
                            忠旺机械平均日工资：
                        </label>
                        <label id="lbl_avg_mac2" class="control-label"
                               th:if="${#strings.contains(cost.code,'制造费') or #strings.contains(cost.code,'包装运输费-包装费')}">
                            <input id="input_avg_mac" readonly="readonly"
                                   style="display: inline-block;
                                   border: none;
                                   box-shadow: 2px 2px 5px #343434 inset;
                                   border-radius: 5px;
                                   outline:none;
                                   text-align: center;
                                   line-height: 36px;"
                                   type="text" maxlength="255"/>
                        </label>
                        <label id="lbl_avg_mac3" class="control-label"
                               th:if="${#strings.contains(cost.code,'-制造费') or #strings.contains(cost.code,'包装运输费-包装费')}">
                            <span>元</span>
                        </label>
                        <label id="lbl_avg_dsn1" class="control-label"
                               th:if="${#strings.contains(cost.code,'-设计费')}">
                            设计平均日工资：
                        </label>
                        <label id="lbl_avg_dsn2" class="control-label"
                               th:if="${#strings.contains(cost.code,'-设计费')}">
                            <input id="input_avg_dsn" readonly="readonly"
                                   style="display: inline-block;
                                   border: none;
                                   box-shadow: 2px 2px 5px #343434 inset;
                                   border-radius: 5px;
                                   outline:none;
                                   text-align: center;
                                   line-height: 36px;"
                                   type="text" maxlength="255"/>
                        </label>
                        <label id="lbl_avg_dsn3" class="control-label"
                               th:if="${#strings.contains(cost.code,'-设计费')}">
                            <span>元</span>
                        </label>
                        <label id="lbl_install_debug1" class="control-label"
                               th:if="${#strings.contains(cost.code,'安装人工') or #strings.contains(cost.code,'调试人工')} ">
                            现场安装/调试平均日工资：
                        </label>
                        <label id="lbl_install_debug2" class="control-label"
                               th:if="${#strings.contains(cost.code,'安装人工') or #strings.contains(cost.code,'调试人工')}">
                            <input id="input_install_debug" readonly="readonly"
                                   style="display: inline-block;
                                   border: none;
                                   box-shadow: 2px 2px 5px #343434 inset;
                                   border-radius: 5px;
                                   outline:none;
                                   text-align: center;
                                   line-height: 36px;"
                                   type="text" maxlength="255"/>
                        </label>
                        <label id="lbl_install_debug3" class="control-label"
                               th:if="${#strings.contains(cost.code,'安装人工') or #strings.contains(cost.code,'调试人工')}">
                            <span>元</span>
                        </label>
                        <label id="lbl_amount1" class="control-label">
                            总金额（不含税）：
                        </label>
                        <label id="lbl_amount2" class="control-label">
                            <input id="input_amount" readonly="readonly"
                                   style="display: inline-block;
                                   border: none;
                                   box-shadow: 2px 2px 5px #343434 inset;
                                   border-radius: 5px;
                                   outline:none;
                                   text-align: center;
                                   line-height: 36px;"
                                   type="text" maxlength="255"/>
                        </label>
                        <label id="lbl_amount3" class="control-label">
                            <span>元</span>
                        </label>
                        <label id="lbl_tax_amount" class="control-label">
                            总金额（含税）：
                        </label>
                        <label id="lbl_tax_amount1" class="control-label">
                            <input id="input_tax_amount" readonly="readonly"
                                   style="display: inline-block;
                                   border: none;
                                   box-shadow: 2px 2px 5px #343434 inset;
                                   border-radius: 5px;
                                   outline:none;
                                   text-align: center;
                                   line-height: 36px;"
                                   type="text" maxlength="255"/>
                        </label>
                        <label id="lbl_tax_amount2" class="control-label">
                            <span>元</span>
                        </label>
                        <label class="control-label">
                            成本项总金额：
                        </label>
                        <label class="control-label">
                            <input id="input_cost_totalPrice" readonly="readonly"
                                   style="display: inline-block;
                                   border: none;
                                   box-shadow: 2px 2px 5px #343434 inset;
                                   border-radius: 5px;
                                   outline:none;
                                   text-align: center;
                                   line-height: 36px;"
                                   type="text" maxlength="255"/>
                        </label>
                        <label class="control-label">
                            <span>元</span>
                        </label>
                    </div>
                </div>
                <div id="toolBar1"
                     th:if="${#strings.contains(cost.code,'-设计费') or #strings.contains(cost.code,'包装运输费-包装费')}">
                    <div class="col-md-12">
                        <button id="btn-valid-data-import1" class="btn btn-success">数据导入</button>
                        <button id="btn-add1" class="btn btn-success">添加数据</button>
                    </div>
                </div>
                <div class="box-body">
                    <table id="bootstrap-table"></table>
                    <table id="bootstrap-table1"></table>
                </div>
            </div>
        </div>
    </div>
</section>

<div th:include="include :: footer"></div>

<script th:inline="javascript">
    let table, table1;
    $(function () {
        /**
         * 当设计重量类别改变时改变其对应的laborType的值
         */
        $("#dsnWeightAddForm [name='laborName']").on('change', function (e) {
            let selectValue = $(this).val();
            if (selectValue === '结构总重') {
                $("#dsnWeightAddForm [name='laborType']").val(3);
            } else {
                $("#dsnWeightAddForm [name='laborType']").val(2);
            }
        });
        /**
         * 校验
         */
        js.validate.init("dsnWeightAddForm", {
            fields: {
                laborNum: {
                    validators: {
                        notEmpty: {message: '请输入设计重量'}
                    }
                }
            }
        });
        /**
         * 校验
         */
        js.validate.init("sprayHoursEditForm", {
            fields: {
                laborName: {
                    validators: {
                        notEmpty: {message: '请输入工时类别'}
                    }
                },
                laborNum: {
                    validators: {
                        notEmpty: {message: '请输入数量'}
                    }
                }
            }
        });
        /**
         * 校验
         */
        js.validate.init("installHoursAddForm", {
            fields: {
                laborName: {
                    validators: {
                        notEmpty: {message: '请输入工时类别'}
                    }
                },
                laborNum: {
                    validators: {
                        notEmpty: {message: '请输入数量'}
                    }
                }
            }
        });
        /**
         * 校验
         */
        js.validate.init("packingHoursAddForm", {
            fields: {
                laborName: {
                    validators: {
                        notEmpty: {message: '请输入工时类别'}
                    }
                },
                laborNum: {
                    validators: {
                        notEmpty: {message: '请输入数量'}
                    }
                }
            }
        });
        /**
         * 校验
         */
        js.validate.init("packingAuxAddForm", {
            fields: {
                laborName: {
                    validators: {
                        notEmpty: {message: '请输入主要辅材类别'}
                    }
                },
                laborNum: {
                    validators: {
                        notEmpty: {message: '请输入主要辅材用量'}
                    }
                },
                price: {
                    validators: {
                        notEmpty: {message: '请输入单价'}
                    }
                },
                unit: {
                    validators: {
                        notEmpty: {message: '请输入单位'}
                    }
                }
            }
        });
        /**
         * 校验
         */
        js.validate.init("heatTreatmentAddForm", {
            fields: {
                laborName: {
                    validators: {
                        notEmpty: {message: '请输热处理形式'}
                    }
                },
                laborNum: {
                    validators: {
                        notEmpty: {message: '请输入数量'}
                    }
                }
                ,
                price: {
                    validators: {
                        notEmpty: {message: '请输入单价'}
                    }
                }
            }
        });
        /**
         * 校验
         */
        js.validate.init("dsnHoursAddForm", {
            fields: {
                laborNum: {
                    validators: {
                        notEmpty: {message: '请输入数量'}
                    }
                }
            }
        });
        /**
         * 校验
         */
        js.validate.init("heatTreatmentEditForm", {
            fields: {
                laborName: {
                    validators: {
                        notEmpty: {message: '请输热处理形式'}
                    }
                },
                laborNum: {
                    validators: {
                        notEmpty: {message: '请输入数量'}
                    }
                }
                ,
                price: {
                    validators: {
                        notEmpty: {message: '请输入单价'}
                    }
                }
            }
        });
        /**
         * 校验
         */
        js.validate.init("sprayAuxEditForm", {
            fields: {
                laborName: {
                    validators: {
                        notEmpty: {message: '请输入主要辅材类别'}
                    }
                },
                laborNum: {
                    validators: {
                        notEmpty: {message: '请输入主要辅材数量'}
                    }
                },
                price: {
                    validators: {
                        notEmpty: {message: '请输入单价'}
                    }
                },
                unit: {
                    validators: {
                        notEmpty: {message: '请输入单位'}
                    }
                }
            }
        });
        /** 验证 */
        js.validate.init("macHoursAddForm", {
            fields: {
                diagram: {
                    validators: {
                        notEmpty: {message: '请输入图号'}
                    }
                },
                drawingNo: {
                    validators: {
                        notEmpty: {message: '请输入图纸名称'}
                    }
                },
                num: {
                    validators: {
                        notEmpty: {message: '请输入数量'}
                    }
                }
            }
        });
        /** 验证 */
        js.validate.init("macHoursEditForm", {
            fields: {
                diagram: {
                    validators: {
                        notEmpty: {message: '请输入图号'}
                    }
                },
                drawingNo: {
                    validators: {
                        notEmpty: {message: '请输入图纸名称'}
                    }
                },
                num: {
                    validators: {
                        notEmpty: {message: '请输入数量'}
                    }
                }
            }
        });

        /** 验证 */
        js.validate.init("matAddForm", {
            fields: {
                matDesc: {
                    validators: {
                        notEmpty: {message: '请输入提报计划物料描述'}
                    }
                },
                num: {
                    validators: {
                        notEmpty: {message: '请输入实用数量'}
                    }
                },
                unit: {
                    validators: {
                        notEmpty: {message: '请输入单位量'}
                    }
                },
                price: {
                    validators: {
                        notEmpty: {message: '请输入单价'}
                    }
                }
            }
        });
        /** 验证 */
        js.validate.init("cutHoursAddForm", {
            fields: {
                laborName: {
                    validators: {
                        notEmpty: {message: '此项必填'}
                    }
                },
                laborNum: {
                    validators: {
                        notEmpty: {message: '请输入数量'}
                    }
                }
            }
        });
        /**
         * 校验
         */
        js.validate.init("cutAuxAddForm", {
            fields: {
                laborName: {
                    validators: {
                        notEmpty: {message: '此项必填'}
                    }
                },
                laborNum: {
                    validators: {
                        notEmpty: {message: '请输入数量'}
                    }
                },
                unit: {
                    validators: {
                        notEmpty: {message: '请输入单位'}
                    }
                },
                price: {
                    validators: {
                        notEmpty: {message: '请输入单价'}
                    }
                }
            }
        });
        /**
         * 校验
         */
        js.validate.init("transportAddForm", {
            fields: {
                placeDelivery: {
                    validators: {
                        notEmpty: {message: '请输入发货地'}
                    }
                }
                , destination: {
                    validators: {
                        notEmpty: {message: '请输入目的地'}
                    }
                }, carNum: {
                    validators: {
                        notEmpty: {message: '请输入车数'}
                    }
                },
                laborNum: {
                    validators: {
                        notEmpty: {message: '请输入重量'}
                    }
                },
                distance: {
                    validators: {
                        notEmpty: {message: '请输入距离'}
                    }
                },
                price: {
                    validators: {
                        notEmpty: {message: '请输入运费'}
                    }
                }
            }
        });
        /**
         * 校验
         */
        js.validate.init("auxAddForm", {
            fields: {
                laborName: {
                    validators: {
                        notEmpty: {message: '此项必填'}
                    }
                },
                laborNum: {
                    validators: {
                        notEmpty: {message: '请输入数量'}
                    }
                },
                unit: {
                    validators: {
                        notEmpty: {message: '请输入单位'}
                    }
                },
                price: {
                    validators: {
                        notEmpty: {message: '请输入单价'}
                    }
                }
            }
        });
        /**
         * 校验
         */
        js.validate.init("purAddForm", {
            fields: {
                matDesc: {
                    validators: {
                        notEmpty: {message: '请输入提报计划物料描述'}
                    }
                },
                num: {
                    validators: {
                        notEmpty: {message: '请输入实用数量'}
                    }
                },
                unit: {
                    validators: {
                        notEmpty: {message: '请输入单位'}
                    }
                },
                price: {
                    validators: {
                        notEmpty: {message: '请输入单价'}
                    }
                }
            }
        });
        /**
         * 校验
         */
        js.validate.init("wholeAddForm", {
            fields: {
                matDesc: {
                    validators: {
                        notEmpty: {message: '请输入提报计划物料描述'}
                    }
                },
                diagram: {
                    validators: {
                        notEmpty: {message: '请输入图号'}
                    }
                },
                num: {
                    validators: {
                        notEmpty: {message: '请输入实用数量'}
                    }
                },
                unit: {
                    validators: {
                        notEmpty: {message: '请输入单位'}
                    }
                },
                price: {
                    validators: {
                        notEmpty: {message: '请输入单价'}
                    }
                }
            }
        });
        /**
         * 校验
         */
        js.validate.init("whithMatAddForm", {
            fields: {
                matDesc: {
                    validators: {
                        notEmpty: {message: '请输入提报计划物料描述'}
                    }
                },
                diagram: {
                    validators: {
                        notEmpty: {message: '请输入图号'}
                    }
                },
                num: {
                    validators: {
                        notEmpty: {message: '请输入实用数量'}
                    }
                },
                unit: {
                    validators: {
                        notEmpty: {message: '请输入单位'}
                    }
                },
                price: {
                    validators: {
                        notEmpty: {message: '请输入单价'}
                    }
                }
            }
        });
        /**
         * 数据模式选择
         */
        $("#select-dataMode").change(function (e) {
            if ($(this).val() === '1') {
                $(this).attr("style", "background:#00a65a;border-color: #008d4c;border-top-color: rgb(0, 141, 76);border-right-color: rgb(0, 141, 76);border-bottom-color: rgb(0, 141, 76);border-left-color: rgb(0, 141, 76);color:#FFFFFF;border-radius: 5px;");
            } else if ($(this).val() === '2') {
                $(this).attr("style", "background:#ff851b;border-color: #985f0d;border-top-color: rgb(152, 95, 13);border-right-color: rgb(152, 95, 13);border-bottom-color: rgb(152, 95, 13);border-left-color: rgb(152, 95, 13);color:#FFFFFF;border-radius: 5px;");
            } else if ($(this).val() === '0') {
                $(this).attr("style", "background:#777777;border-color: #008d4c;border-top-color: rgb(0, 141, 76);border-right-color: rgb(0, 141, 76);border-bottom-color: rgb(0, 141, 76);border-left-color: rgb(0, 141, 76);color:#FFFFFF;border-radius: 5px;");
            }
            $("#queryForm [name='isEffectiveFlag']").val($(this).val());
            js.table.refresh(table);
            if (table1 != undefined) {
                js.table.refresh(table1);
            }
        })
        /**
         * 当页面关闭时重新加载打开它的页面的方法。
         */
        $(window).bind('beforeunload', function () {
            window.opener.loadCostSheetFun($("#queryForm [name='id']").val());
        });
        /**
         * 去小数点后无效0
         */
        $("#input_amount").val(dealingWithDecimals($("#input_amount").val()));
        /**
         * 去小数点后无效0
         */
        $("#input_tax_amount").val(dealingWithDecimals($("#input_tax_amount").val()));
        /**
         * 去小数点后无效0
         */
        $("#input_cost_totalPrice").val(dealingWithDecimals($("#input_cost_totalPrice").val()));
        //加载参数
        initParam();
        //加载原材料数据
        initItemList();
        //加载金额
        getRawMatAmount();
        //加载工序列表
        loadProcessList();
        //获取设备类型
        loadNameTypeList();
        //搜索
        $("#btn-search").on('click', function (e) {
            js.table.refresh(table)
        });

        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-edit", function () {
            js.validate.reset("edit-form");
            js.reset("edit-form");
            js.validate.destroy("edit-form");
        });
        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-mat-add", function () {
            js.validate.reset("matAddForm");
            js.reset("matAddForm");
            js.validate.destroy("matAddForm");
        });
        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-import-install", function () {
            js.validate.reset("importInstallForm");
            $("#importInstallForm [name='file']").val(null);
        });
        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-dsn-hours-add", function () {
            js.validate.reset("dsnHoursAddForm");
            $("#dsnHoursAddForm [name='laborNum']").val(null);
            $("#dsnHoursAddForm [name='id']").val(null);
        });
        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-dsn-weight-add", function () {
            js.validate.reset("dsnWeightAddForm");
            $("#dsnWeightAddForm [name='laborName']").val('结构总重');
            $("#dsnWeightAddForm [name='laborType']").val(3);
            $("#dsnWeightAddForm [name='laborNum']").val(null);
            $("#dsnWeightAddForm [name='id']").val(null);
        });
        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-import-debug", function () {
            js.validate.reset("importDebugForm");
            $("#importDebugForm [name='file']").val(null);
        });
        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-import-design-hours", function () {
            js.validate.reset("importDesignHoursForm");
            $("#importDesignHoursForm [name='file']").val(null);
        });
        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-import-design-weight", function () {
            js.validate.reset("importDesignWeightForm");
            $("#importDesignWeightForm [name='file']").val(null);
        });
        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-import-aux", function () {
            js.validate.reset("importAuxForm");
            $("#importAuxForm [name='file']").val(null);
        });
        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-import-transport", function () {
            js.validate.reset("importTransportForm");
            $("#importTransportForm [name='file']").val(null);
        });
        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-import-cut", function () {
            js.validate.reset("importCutForm");
            $("#importCutForm [name='file']").val(null);
        });
        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-import-packing-hours", function () {
            js.validate.reset("importPackingHoursForm");
            $("#importPackingHoursForm [name='file']").val(null);
        });
        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-import-packing-aux", function () {
            js.validate.reset("importPackingAuxForm");
            $("#importPackingAuxForm [name='file']").val(null);
        });
        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-pur-add", function () {
            js.validate.reset("purAddForm");
            $("#purAddForm [name='matDesc']").val(null);
            $("#purAddForm [name='num']").val(null);
            $("#purAddForm [name='unit']").val(null);
            $("#purAddForm [name='standardNo']").val(null);
            $("#purAddForm [name='brand']").val(null);
            $("#purAddForm [name='remark']").val(null);
            $("#purAddForm [name='sapCode']").val(null);
            $("#purAddForm [name='buyMatDesc']").val(null);
            $("#purAddForm [name='price']").val(null);
            $("#matDescList").empty();
        });
        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-spray-edit", function () {
            js.validate.reset("sprayHoursEditForm");
            js.reset("sprayHoursEditForm");
            js.validate.reset("sprayAuxEditForm");
            js.reset("sprayAuxEditForm");
        });
        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-mac-add", function () {
            js.validate.reset("macHoursAddForm");
            $("#macHoursAddForm [name='diagram']").val(null);
            $("#macHoursAddForm [name='drawingNo']").val(null);
            $("#macHoursAddForm [name='num']").val(null);
            $("#macHoursAddForm [name='workHoursStr']").val(0);
            $("#macHoursAddForm [name='workMinuteStr']").val(0);
        });
        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-heatTreatment-edit", function () {
            js.validate.reset("heatTreatmentEditForm");
            $("#heatTreatmentEditForm [name='laborName']").val(null);
            $("#heatTreatmentEditForm [name='laborNum']").val(null);
            $("#heatTreatmentEditForm [name='price']").val(null);
        });
        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-heatTreatment-add", function () {
            js.validate.reset("heatTreatmentAddForm");
            $("#heatTreatmentAddForm [name='laborName']").val(null);
            $("#heatTreatmentAddForm [name='laborNum']").val(null);
            $("#heatTreatmentAddForm [name='price']").val(null);
        });
        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-whole-add", function () {
            js.validate.reset("wholeAddForm");
            $("#wholeAddForm [name='matDesc']").val(null);
            $("#wholeAddForm [name='diagram']").val(null);
            $("#wholeAddForm [name='num']").val(null);
            $("#wholeAddForm [name='unit']").val(null);
            $("#wholeAddForm [name='remark']").val(null);
            $("#wholeAddForm [name='sapCode']").val(null);
            $("#wholeAddForm [name='buyMatDesc']").val(null);
            $("#wholeAddForm [name='price']").val(null);
            $("#wholeAddForm [name='id']").val(null);
        });
        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-whithMat-add", function () {
            js.validate.reset("whithMatAddForm");
            $("#whithMatAddForm [name='matDesc']").val(null);
            $("#whithMatAddForm [name='diagram']").val(null);
            $("#whithMatAddForm [name='num']").val(null);
            $("#whithMatAddForm [name='unit']").val(null);
            $("#whithMatAddForm [name='remark']").val(null);
            $("#whithMatAddForm [name='sapCode']").val(null);
            $("#whithMatAddForm [name='buyMatDesc']").val(null);
            $("#whithMatAddForm [name='price']").val(null);
            $("#whithMatAddForm [name='id']").val(null);
        });
        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-mac-edit", function () {
            js.validate.reset("macHoursEditForm");
            js.reset("macHoursEditForm");
        });
        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-import-withMat", function () {
            js.validate.reset("importwithMatForm");
            $("#importwithMatForm [name='file']").val(null);
        });
        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-import-whole", function () {
            js.validate.reset("importWholeForm");
            $("#importWholeForm [name='file']").val(null);
        });
        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-install-add", function () {
            js.validate.reset("installHoursAddForm");
            $("#installHoursAddForm [name='laborName']").val(null);
            $("#installHoursAddForm [name='laborNum']").val(null);
            $("#installHoursAddForm [name='id']").val(null);
        });
        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-packing-hours-add", function () {
            js.validate.reset("packingHoursAddForm");
            $("#packingHoursAddForm [name='laborName']").val(null);
            $("#packingHoursAddForm [name='laborNum']").val(null);
            $("#packingHoursAddForm [name='id']").val(null);
        });
        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-transport-add", function () {
            js.validate.reset("transportAddForm");
            $("#transportAddForm [name='placeDelivery']").val(null);
            $("#transportAddForm [name='destination']").val(null);
            $("#transportAddForm [name='laborNum']").val(null);
            $("#transportAddForm [name='carNum']").val(null);
            $("#transportAddForm [name='distance']").val(null);
            $("#transportAddForm [name='price']").val(null);
            $("#transportAddForm [name='remark']").val(null);
            $("#transportAddForm [name='id']").val(null);
        });
        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-packing-aux-add", function () {
            js.validate.reset("packingAuxAddForm");
            $("#packingAuxAddForm [name='laborName']").val(null);
            $("#packingAuxAddForm [name='laborNum']").val(null);
            $("#packingAuxAddForm [name='unit']").val(null);
            $("#packingAuxAddForm [name='price']").val(null);
            $("#packingAuxAddForm [name='id']").val(null);
        });
        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-cut-add", function () {
            js.validate.reset("cutHoursAddForm");
            js.validate.reset("cutAuxAddForm");
            $("#cutHoursAddForm [name='laborName']").val(null);
            $("#cutHoursAddForm [name='laborNum']").val(null);
            $("#cutAuxAddForm [name='laborName']").val(null);
            $("#cutAuxAddForm [name='laborNum']").val(null);
            $("#cutAuxAddForm [name='price']").val(null);
            $("#cutAuxAddForm [name='unit']").val(null);
        });
        /**
         * 模态框隐藏事件， 重置表单，重置验证
         */
        js.modal.hideEvent("modal-install-debug", function () {
            js.validate.reset("debugHoursAddForm");
            $("#debugHoursAddForm [name='laborName']").val(null);
            $("#debugHoursAddForm [name='laborNum']").val(null);
            $("#debugHoursAddForm [name='id']").val(null);
        });

        /**
         * 保存添加
         */
        $("#btn-save-add").on('click', function (e) {
            js.validSubmit({
                formId: "matAddForm",
                url: ctx + "estimateManage/matSaveAdd",
                data: new FormData($("#matAddForm")[0]),
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        js.modal.success(result.msg);
                        js.table.refresh(table);
                        js.modal.hide('modal-mat-add');
                    } else {
                        s.modal.warning(result.msg);
                    }
                    js.modal.closeLoading();
                },
                error: function () {
                    s.modal.warning(result.msg);
                    js.modal.closeLoading();
                }
            });
        });
        /**
         * 整体外协保存添加
         */
        $("#btn-save-add-whole").on('click', function (e) {
            js.validSubmit({
                formId: "wholeAddForm",
                url: ctx + "estimateManage/wholeSaveAdd",
                data: new FormData($("#wholeAddForm")[0]),
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        js.modal.success(result.msg);
                        js.table.refresh(table);
                        js.modal.hide('modal-whole-add');
                    } else {
                        s.modal.warning(result.msg);
                    }
                    js.modal.closeLoading();
                },
                error: function () {
                    s.modal.warning(result.msg);
                    js.modal.closeLoading();
                }
            });
        });
        /**
         * 带料外协保存添加
         */
        $("#btn-save-add-whithMat").on('click', function (e) {
            js.validSubmit({
                formId: "whithMatAddForm",
                url: ctx + "estimateManage/whithMatSaveAdd",
                data: new FormData($("#whithMatAddForm")[0]),
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        js.modal.success(result.msg);
                        js.table.refresh(table);
                        js.modal.hide('modal-whithMat-add');
                    } else {
                        s.modal.warning(result.msg);
                    }
                    js.modal.closeLoading();
                },
                error: function () {
                    s.modal.warning(result.msg);
                    js.modal.closeLoading();
                }
            });
        });
        /**
         * 保存添加
         */
        $("#btn-save-mac-hours").on('click', function (e) {
            js.validSubmit({
                formId: "macHoursAddForm",
                url: ctx + "estimateManage/macSaveAdd",
                data: new FormData($("#macHoursAddForm")[0]),
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        js.modal.success(result.msg);
                        js.table.refresh(table);
                        js.modal.hide('modal-mac-add');
                    } else {
                        s.modal.warning(result.msg);
                    }
                    js.modal.closeLoading();
                },
                error: function () {
                    s.modal.warning(result.msg);
                    js.modal.closeLoading();
                }
            });
        })
        /**
         * 保存修改
         */
        $("#btn-save-edit-mac-hours").on('click', function (e) {
            js.validSubmit({
                formId: "macHoursEditForm",
                url: ctx + "estimateManage/macSaveEdit",
                data: new FormData($("#macHoursEditForm")[0]),
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        js.modal.success(result.msg);
                        js.table.refresh(table);
                        js.modal.hide('modal-mac-edit');
                    } else {
                        s.modal.warning(result.msg);
                    }
                    js.modal.closeLoading();
                },
                error: function () {
                    s.modal.warning(result.msg);
                    js.modal.closeLoading();
                }
            });
        })
        /**
         * 保存修改
         */
        $("#btn-save-edit-spray").on('click', function (e) {
            $("#modal-nav-spray li").each(function (index, obj) {
                if ($(this).attr("class").indexOf("active") > -1) {
                    if (index === 0) {
                        js.validSubmit({
                            formId: "sprayHoursEditForm",
                            url: ctx + "estimateManage/spraySave",
                            data: new FormData($("#sprayHoursEditForm")[0]),
                            success: function (result) {
                                if (result.type === web_status.SUCCESS) {
                                    js.modal.success(result.msg);
                                    js.table.refresh(table);
                                    if (table1 != undefined) {
                                        js.table.refresh(table1);
                                    }
                                    js.modal.hide('modal-spray-edit');
                                } else {
                                    s.modal.warning(result.msg);
                                }
                                js.modal.closeLoading();
                            },
                            error: function () {
                                s.modal.warning(result.msg);
                                js.modal.closeLoading();
                            }
                        });
                    } else if (index === 1) {
                        js.validSubmit({
                            formId: "sprayAuxEditForm",
                            url: ctx + "estimateManage/spraySave",
                            data: new FormData($("#sprayAuxEditForm")[0]),
                            success: function (result) {
                                if (result.type === web_status.SUCCESS) {
                                    js.modal.success(result.msg);
                                    js.table.refresh(table);
                                    if (table1 != undefined) {
                                        js.table.refresh(table1);
                                    }
                                    js.modal.hide('modal-spray-edit');
                                } else {
                                    s.modal.warning(result.msg);
                                }
                                js.modal.closeLoading();
                            },
                            error: function () {
                                s.modal.warning(result.msg);
                                js.modal.closeLoading();
                            }
                        });
                    }
                }
            });
        })
        /**
         * 下料保存添加
         * */
        $("#btn-save-add-cut").on('click', function (e) {
            $("#modal-nav li").each(function (index, obj) {
                if ($(this).attr("class").indexOf("active") > -1) {
                    if (index === 0) {
                        js.validSubmit({
                            formId: "cutHoursAddForm",
                            url: ctx + "estimateManage/cutHoursSaveAdd",
                            data: new FormData($("#cutHoursAddForm")[0]),
                            success: function (result) {
                                if (result.type === web_status.SUCCESS) {
                                    js.modal.success(result.msg);
                                    js.table.refresh(table);
                                    if (table1 != undefined) {
                                        js.table.refresh(table1);
                                    }
                                    js.modal.hide('modal-cut-add');
                                } else {
                                    s.modal.warning(result.msg);
                                }
                                js.modal.closeLoading();
                            },
                            error: function () {
                                s.modal.warning(result.msg);
                                js.modal.closeLoading();
                            }
                        });
                    } else if (index === 1) {
                        js.validSubmit({
                            formId: "cutAuxAddForm",
                            url: ctx + "estimateManage/cutHoursSaveAdd",
                            data: new FormData($("#cutAuxAddForm")[0]),
                            success: function (result) {
                                if (result.type === web_status.SUCCESS) {
                                    js.modal.success(result.msg);
                                    js.table.refresh(table);
                                    if (table1 != undefined) {
                                        js.table.refresh(table1);
                                    }
                                    js.modal.hide('modal-heatTreatment-add');
                                } else {
                                    s.modal.warning(result.msg);
                                }
                                js.modal.closeLoading();
                            },
                            error: function () {
                                s.modal.warning(result.msg);
                                js.modal.closeLoading();
                            }
                        });
                    }
                }
            });

        })
        /**
         * 现场安装辅材保存添加
         * */
        $("#btn-save-add-aux").on('click', function (e) {
            if ($("#auxAddForm [name='id']").val() != null && $("#auxAddForm [name='id']").val() != '') {
                js.validSubmit({
                    formId: "auxAddForm",
                    url: ctx + "estimateManage/auxSaveUpdate",
                    data: new FormData($("#auxAddForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.success(result.msg);
                            js.table.refresh(table);
                            if (table1 != undefined) {
                                js.table.refresh(table1);
                            }
                            js.modal.hide('modal-aux-add');
                        } else {
                            s.modal.warning(result.msg);
                        }
                        js.modal.closeLoading();
                    },
                    error: function () {
                        s.modal.warning(result.msg);
                        js.modal.closeLoading();
                    }
                });
            } else {
                js.validSubmit({
                    formId: "auxAddForm",
                    url: ctx + "estimateManage/auxSaveAdd",
                    data: new FormData($("#auxAddForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.success(result.msg);
                            js.table.refresh(table);
                            if (table1 != undefined) {
                                js.table.refresh(table1);
                            }
                            js.modal.hide('modal-aux-add');
                        } else {
                            s.modal.warning(result.msg);
                        }
                        js.modal.closeLoading();
                    },
                    error: function () {
                        s.modal.warning(result.msg);
                        js.modal.closeLoading();
                    }
                });
            }
        })
        /**
         * 热处理添加
         */
        $("#btn-save-add-heatTreatment").on('click', function (e) {
            js.validSubmit({
                formId: "heatTreatmentAddForm",
                url: ctx + "estimateManage/heatTreatmentHoursSaveAdd",
                data: new FormData($("#heatTreatmentAddForm")[0]),
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        js.modal.success(result.msg);
                        js.table.refresh(table);
                        if (table1 != undefined) {
                            js.table.refresh(table1);
                        }
                        js.modal.hide('modal-heatTreatment-add');
                    } else {
                        s.modal.warning(result.msg);
                    }
                    js.modal.closeLoading();
                },
                error: function () {
                    s.modal.warning(result.msg);
                    js.modal.closeLoading();
                }
            });
        })
        /**
         * 运费添加
         */
        $("#btn-save-add-transport").on('click', function (e) {
            if ($("#transportAddForm [name='id']").val() != null && $("#transportAddForm [name='id']").val() != '') {
                js.validSubmit({
                    formId: "transportAddForm",
                    url: ctx + "estimateManage/updateTransportSave",
                    data: new FormData($("#transportAddForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.success(result.msg);
                            js.table.refresh(table);
                            js.modal.hide('modal-transport-add');
                        } else {
                            s.modal.warning(result.msg);
                        }
                        js.modal.closeLoading();
                    },
                    error: function () {
                        s.modal.warning(result.msg);
                        js.modal.closeLoading();
                    }
                });
            } else {
                js.validSubmit({
                    formId: "transportAddForm",
                    url: ctx + "estimateManage/transportSaveAdd",
                    data: new FormData($("#transportAddForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.success(result.msg);
                            js.table.refresh(table);
                            js.modal.hide('modal-transport-add');
                        } else {
                            s.modal.warning(result.msg);
                        }
                        js.modal.closeLoading();
                    },
                    error: function () {
                        s.modal.warning(result.msg);
                        js.modal.closeLoading();
                    }
                });
            }
        });
        /**
         * 安装添加
         */
        $("#btn-save-add-install").on('click', function (e) {
            if ($("#installHoursAddForm [name='id']").val() != null && $("#installHoursAddForm [name='id']").val() != '') {
                js.validSubmit({
                    formId: "installHoursAddForm",
                    url: ctx + "estimateManage/updateInstallHoursSave",
                    data: new FormData($("#installHoursAddForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.success(result.msg);
                            js.table.refresh(table);
                            if (table1 != undefined) {
                                js.table.refresh(table1);
                            }
                            js.modal.hide('modal-install-add');
                        } else {
                            s.modal.warning(result.msg);
                        }
                        js.modal.closeLoading();
                    },
                    error: function () {
                        s.modal.warning(result.msg);
                        js.modal.closeLoading();
                    }
                });
            } else {
                js.validSubmit({
                    formId: "installHoursAddForm",
                    url: ctx + "estimateManage/installHoursSaveAdd",
                    data: new FormData($("#installHoursAddForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.success(result.msg);
                            js.table.refresh(table);
                            if (table1 != undefined) {
                                js.table.refresh(table1);
                            }
                            js.modal.hide('modal-install-add');
                        } else {
                            s.modal.warning(result.msg);
                        }
                        js.modal.closeLoading();
                    },
                    error: function () {
                        s.modal.warning(result.msg);
                        js.modal.closeLoading();
                    }
                });
            }

        })
        /**
         * 包装工时添加
         */
        $("#btn-save-add-packingHours").on('click', function (e) {
            if ($("#packingHoursAddForm [name='id']").val() != null && $("#packingHoursAddForm [name='id']").val() != '') {
                js.validSubmit({
                    formId: "packingHoursAddForm",
                    url: ctx + "estimateManage/updatePackingHoursSave",
                    data: new FormData($("#packingHoursAddForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.success(result.msg);
                            js.table.refresh(table);
                            if (table1 != undefined) {
                                js.table.refresh(table1);
                            }
                            js.modal.hide('modal-packing-hours-add');
                        } else {
                            s.modal.warning(result.msg);
                        }
                        js.modal.closeLoading();
                    },
                    error: function () {
                        s.modal.warning(result.msg);
                        js.modal.closeLoading();
                    }
                });
            } else {
                js.validSubmit({
                    formId: "packingHoursAddForm",
                    url: ctx + "estimateManage/packingHoursSaveAdd",
                    data: new FormData($("#packingHoursAddForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.success(result.msg);
                            js.table.refresh(table);
                            if (table1 != undefined) {
                                js.table.refresh(table1);
                            }
                            js.modal.hide('modal-packing-hours-add');
                        } else {
                            s.modal.warning(result.msg);
                        }
                        js.modal.closeLoading();
                    },
                    error: function () {
                        s.modal.warning(result.msg);
                        js.modal.closeLoading();
                    }
                });
            }
        })
        /**
         * 包装辅材添加
         */
        $("#btn-save-add-packingAux").on('click', function (e) {
            if ($("#packingAuxAddForm [name='id']").val() != null && $("#packingAuxAddForm [name='id']").val() != '') {
                js.validSubmit({
                    formId: "packingAuxAddForm",
                    url: ctx + "estimateManage/updatePackingAuxSave",
                    data: new FormData($("#packingAuxAddForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.success(result.msg);
                            js.table.refresh(table);
                            if (table1 != undefined) {
                                js.table.refresh(table1);
                            }
                            js.modal.hide('modal-packing-aux-add');
                        } else {
                            s.modal.warning(result.msg);
                        }
                        js.modal.closeLoading();
                    },
                    error: function () {
                        s.modal.warning(result.msg);
                        js.modal.closeLoading();
                    }
                });
            } else {
                js.validSubmit({
                    formId: "packingAuxAddForm",
                    url: ctx + "estimateManage/packingHoursSaveAdd",
                    data: new FormData($("#packingAuxAddForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.success(result.msg);
                            js.table.refresh(table);
                            if (table1 != undefined) {
                                js.table.refresh(table1);
                            }
                            js.modal.hide('modal-packing-aux-add');
                        } else {
                            s.modal.warning(result.msg);
                        }
                        js.modal.closeLoading();
                    },
                    error: function () {
                        s.modal.warning(result.msg);
                        js.modal.closeLoading();
                    }
                });
            }
        })
        /**
         * 调试添加
         */
        $("#btn-save-add-debug").on('click', function (e) {
            if ($("#debugHoursAddForm [name='id']").val() != null && $("#debugHoursAddForm [name='id']").val() != '') {
                js.validSubmit({
                    formId: "debugHoursAddForm",
                    url: ctx + "estimateManage/updateDebugHoursSave",
                    data: new FormData($("#debugHoursAddForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.success(result.msg);
                            js.table.refresh(table);
                            if (table1 != undefined) {
                                js.table.refresh(table1);
                            }
                            js.modal.hide('modal-debug-add');
                        } else {
                            s.modal.warning(result.msg);
                        }
                        js.modal.closeLoading();
                    },
                    error: function () {
                        s.modal.warning(result.msg);
                        js.modal.closeLoading();
                    }
                });
            } else {
                js.validSubmit({
                    formId: "debugHoursAddForm",
                    url: ctx + "estimateManage/debugHoursSaveAdd",
                    data: new FormData($("#debugHoursAddForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.success(result.msg);
                            js.table.refresh(table);
                            if (table1 != undefined) {
                                js.table.refresh(table1);
                            }
                            js.modal.hide('modal-debug-add');
                        } else {
                            s.modal.warning(result.msg);
                        }
                        js.modal.closeLoading();
                    },
                    error: function () {
                        s.modal.warning(result.msg);
                        js.modal.closeLoading();
                    }
                });
            }
        })
        /**
         * 设计工时添加与编辑
         */
        $("#btn-save-dsn-hours").on('click', function (e) {
            if ($("#dsnHoursAddForm [name='id']").val() != null && $("#dsnHoursAddForm [name='id']").val() != '') {
                js.validSubmit({
                    formId: "dsnHoursAddForm",
                    url: ctx + "estimateManage/updateDsnHoursSave",
                    data: new FormData($("#dsnHoursAddForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.success(result.msg);
                            js.table.refresh(table);
                            if (table1 != undefined) {
                                js.table.refresh(table1);
                            }
                            js.modal.hide('modal-dsn-hours-add');
                        } else {
                            s.modal.warning(result.msg);
                        }
                        js.modal.closeLoading();
                    },
                    error: function () {
                        s.modal.warning(result.msg);
                        js.modal.closeLoading();
                    }
                });
            } else {
                js.validSubmit({
                    formId: "dsnHoursAddForm",
                    url: ctx + "estimateManage/debugHoursSaveAdd",
                    data: new FormData($("#dsnHoursAddForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.success(result.msg);
                            js.table.refresh(table);
                            js.modal.hide('modal-dsn-hours-add');
                        } else {
                            s.modal.warning(result.msg);
                        }
                        js.modal.closeLoading();
                    },
                    error: function () {
                        s.modal.warning(result.msg);
                        js.modal.closeLoading();
                    }
                });
            }
        })
        /**
         * 设计重量添加与编辑
         */
        $("#btn-save-dsn-weight").on('click', function (e) {
            if ($("#dsnWeightAddForm [name='id']").val() != null && $("#dsnWeightAddForm [name='id']").val() != '') {
                js.validSubmit({
                    formId: "dsnWeightAddForm",
                    url: ctx + "estimateManage/updateDsnHoursSave",
                    data: new FormData($("#dsnWeightAddForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.success(result.msg);
                            js.table.refresh(table1);
                            js.modal.hide('modal-dsn-weight-add');
                        } else {
                            s.modal.warning(result.msg);
                        }
                        js.modal.closeLoading();
                    },
                    error: function () {
                        s.modal.warning(result.msg);
                        js.modal.closeLoading();
                    }
                });
            } else {
                js.validSubmit({
                    formId: "dsnWeightAddForm",
                    url: ctx + "estimateManage/debugHoursSaveAdd",
                    data: new FormData($("#dsnWeightAddForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.success(result.msg);
                            js.table.refresh(table1);
                            js.modal.hide('modal-dsn-weight-add');
                        } else {
                            s.modal.warning(result.msg);
                        }
                        js.modal.closeLoading();
                    },
                    error: function () {
                        s.modal.warning(result.msg);
                        js.modal.closeLoading();
                    }
                });
            }
        })
        /**
         * 外购费添加
         */
        $("#btn-save-add-pur").on('click', function (e) {
            js.validSubmit({
                formId: "purAddForm",
                url: ctx + "estimateManage/purSave",
                data: new FormData($("#purAddForm")[0]),
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        js.modal.success(result.msg);
                        js.table.refresh(table);
                        if (table1 != undefined) {
                            js.table.refresh(table1);
                        }
                        js.modal.hide('modal-pur-add');
                    } else {
                        s.modal.warning(result.msg);
                    }
                    js.modal.closeLoading();
                },
                error: function () {
                    s.modal.warning(result.msg);
                    js.modal.closeLoading();
                }
            });
        })

        /**
         * 保存编辑
         * */
        $("#btn-save-edit").on('click', function (e) {
            $("#edit-form [name='priceType']").val(2);
            js.validSubmit({
                formId: "edit-form",
                url: ctx + "accountingInfo/saveEdit",
                data: new FormData($("#edit-form")[0]),
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        js.modal.success(result.msg);
                        js.table.refresh(table);
                        if (table1 != undefined) {
                            js.table.refresh(table1);
                        }
                        js.modal.hide('modal-edit');
                    } else {
                        s.modal.warning(result.msg);
                    }
                    js.modal.closeLoading();
                },
                error: function () {
                    s.modal.warning(result.msg);
                    js.modal.closeLoading();
                }
            });
        })
        /**
         * 保存编辑热处理
         */
        $("#btn-save-edit-heatTreatment").on('click', function (e) {
            $("#edit-form [name='priceType']").val(2);
            js.validSubmit({
                formId: "heatTreatmentEditForm",
                url: ctx + "accountingInfo/saveHeatTreatmentEdit",
                data: new FormData($("#heatTreatmentEditForm")[0]),
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        js.modal.success(result.msg);
                        js.table.refresh(table);
                        js.modal.hide('modal-heatTreatment-edit');
                    } else {
                        s.modal.warning(result.msg);
                    }
                    js.modal.closeLoading();
                },
                error: function () {
                    s.modal.warning(result.msg);
                    js.modal.closeLoading();
                }
            });
        })

        /**
         * 自动计算并完结
         * */
        $("#btn-calculationFinish").on("click", function (e) {
            js.post({
                url: ctx + 'accountingInfo/automaticCalculationRawMaterial',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: $("#queryForm").serialize(),
                async: true,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        $("#input_tax").val(result.data.tax);
                        $("#input_amount").val(result.data.totalAmount);
                        $("#input_tax_amount").val(result.data.totalAmountTax);
                        if (result.data.busBudgetAccountingCost.finishStatus === 3) {
                            $("#finishStatus").attr("class", "badge label-success");
                            $("#finishStatus").text("完结");
                            window.opener.loadCostSheet();
                            location.reload();
                        }
                    } else {
                        js.modal.warning(result.msg);
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        })

        /**
         * 取消完结
         * */
        $("#btn-cancelFinish").on("click", function (e) {
            js.post({
                url: ctx + 'accountingInfo/cancelCalculationFinishRawMaterial',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: $("#queryForm").serialize(),
                async: true,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        if (result.data.busBudgetAccountingCost.finishStatus === 2) {
                            $("#finishStatus").attr("class", "badge label-warning");
                            $("#finishStatus").text("执行中");
                            window.opener.loadCostSheet();
                            location.reload();
                        }
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        })
        /** 导入表单验证 */
        js.validate.init("importForm", {
            fields: {
                file: {
                    validators: {
                        notEmpty: {message: '上传文件不能为空'},
                        file: {extension: 'xls,xlsx', message: '请选择excel文件'}
                    }
                }
            }
        });
        /** 导入表单验证 */
        js.validate.init("importAuxForm", {
            fields: {
                file: {
                    validators: {
                        notEmpty: {message: '上传文件不能为空'},
                        file: {extension: 'xls,xlsx', message: '请选择excel文件'}
                    }
                }
            }
        });
        /** 导入表单验证 */
        js.validate.init("importTransportForm", {
            fields: {
                file: {
                    validators: {
                        notEmpty: {message: '上传文件不能为空'},
                        file: {extension: 'xls,xlsx', message: '请选择excel文件'}
                    }
                }
            }
        });
        /** 导入表单验证 */
        js.validate.init("importCutForm", {
            fields: {
                file: {
                    validators: {
                        notEmpty: {message: '上传文件不能为空'},
                        file: {extension: 'xls,xlsx', message: '请选择excel文件'}
                    }
                }
            }
        });
        /** 导入表单验证 */
        js.validate.init("importPackingHoursForm", {
            fields: {
                file: {
                    validators: {
                        notEmpty: {message: '上传文件不能为空'},
                        file: {extension: 'xls,xlsx', message: '请选择excel文件'}
                    }
                }
            }
        });
        /** 导入表单验证 */
        js.validate.init("importPackingAuxForm", {
            fields: {
                file: {
                    validators: {
                        notEmpty: {message: '上传文件不能为空'},
                        file: {extension: 'xls,xlsx', message: '请选择excel文件'}
                    }
                }
            }
        });
        /** 导入表单验证 */
        js.validate.init("importInstallForm", {
            fields: {
                file: {
                    validators: {
                        notEmpty: {message: '上传文件不能为空'},
                        file: {extension: 'xls,xlsx', message: '请选择excel文件'}
                    }
                }
            }
        });
        /** 导入表单验证 */
        js.validate.init("importDebugForm", {
            fields: {
                file: {
                    validators: {
                        notEmpty: {message: '上传文件不能为空'},
                        file: {extension: 'xls,xlsx', message: '请选择excel文件'}
                    }
                }
            }
        });
        /** 导入表单验证 */
        js.validate.init("importDesignHoursForm", {
            fields: {
                file: {
                    validators: {
                        notEmpty: {message: '上传文件不能为空'},
                        file: {extension: 'xls,xlsx', message: '请选择excel文件'}
                    }
                }
            }
        });
        /** 导入表单验证 */
        js.validate.init("importDesignWeightForm", {
            fields: {
                file: {
                    validators: {
                        notEmpty: {message: '上传文件不能为空'},
                        file: {extension: 'xls,xlsx', message: '请选择excel文件'}
                    }
                }
            }
        });
        /** 导入表单验证 */
        js.validate.init("importWholeForm", {
            fields: {
                file: {
                    validators: {
                        notEmpty: {message: '上传文件不能为空'},
                        file: {extension: 'xls,xlsx', message: '请选择excel文件'}
                    }
                }
            }
        });

        /** 导入表单验证 */
        js.validate.init("importWithMatForm", {
            fields: {
                file: {
                    validators: {
                        notEmpty: {message: '上传文件不能为空'},
                        file: {extension: 'xls,xlsx', message: '请选择excel文件'}
                    }
                }
            }
        });
        /** 导入表单验证 */
        js.validate.init("importPurForm", {
            fields: {
                file: {
                    validators: {
                        notEmpty: {message: '上传文件不能为空'},
                        file: {extension: 'xls,xlsx', message: '请选择excel文件'}
                    }
                }
            }
        });
        // /** 导入表单验证 */
        // js.validate.init("importCutForm", {
        //     fields: {
        //         file: {
        //             validators: {
        //                 notEmpty: {message: '上传文件不能为空'},
        //                 file: {extension: 'xls,xlsx', message: '请选择excel文件'}
        //             }
        //         }
        //     }
        // });/** 导入表单验证 */
        // js.validate.init("importRivetAndSolderForm", {
        //     fields: {
        //         file: {
        //             validators: {
        //                 notEmpty: {message: '上传文件不能为空'},
        //                 file: {extension: 'xls,xlsx', message: '请选择excel文件'}
        //             }
        //         }
        //     }
        // });
        /** 导入模态框隐藏事件 */
        js.modal.hideEvent("modal-import", function () {
            js.validate.reset("importForm");
            $("#importForm [name='file']").val(null);
        });
        /** 导入计划 */
        $("#btn-upload").click(function () {
            js.modal.confirm("尊敬的用户，导入数据会导致当前表数据被清空或无效，您确认要继续导入数据吗？", function () {
                var $this = $(this);
                $this.attr('disabled', true);
                js.validSubmit({
                    formId: "importForm",
                    url: ctx + "accountingInfo/rawMatImport",
                    data: new FormData($("#importForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.alert(result.msg);
                            if (result.msg == '导入完成') {
                                js.modal.hide("modal-import");
                            }
                            js.table.refresh(table);
                            $this.attr('disabled', false);
                        }
                    }
                });
            })
        });
        /** 导入外购费 */
        $("#btn-upload-pur").click(function () {
            js.modal.confirm("尊敬的用户，导入数据会导致当前表数据被清空或无效，您确认要继续导入数据吗？", function () {
                var $this = $(this);
                $this.attr('disabled', true);
                js.validSubmit({
                    formId: "importPurForm",
                    url: ctx + "accountingInfo/purImport",
                    data: new FormData($("#importPurForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.alert(result.msg);
                            if (result.msg == '导入完成') {
                                js.modal.hide("modal-import-pur");
                            }
                            js.table.refresh(table);
                            $this.attr('disabled', false);
                        }
                    }
                });
            })
        });
        /** 导入安装工时 */
        $("#btn-upload-install").click(function () {
            js.modal.confirm("尊敬的用户，导入数据会导致当前表数据被清空或无效，您确认要继续导入数据吗？", function () {
                var $this = $(this);
                $this.attr('disabled', true);
                js.validSubmit({
                    formId: "importInstallForm",
                    url: ctx + "accountingInfo/installImport",
                    data: new FormData($("#importInstallForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.alert(result.msg);
                            if (result.msg == '导入完成') {
                                js.modal.hide("modal-import-install");
                            }
                            js.table.refresh(table);
                            $this.attr('disabled', false);
                        }
                    }
                });
            })
        });
        /** 导入调试工时 */
        $("#btn-upload-debug").click(function () {
            js.modal.confirm("尊敬的用户，导入数据会导致当前表数据被清空或无效，您确认要继续导入数据吗？", function () {
                var $this = $(this);
                $this.attr('disabled', true);
                js.validSubmit({
                    formId: "importDebugForm",
                    url: ctx + "accountingInfo/debugImport",
                    data: new FormData($("#importDebugForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.alert(result.msg);
                            if (result.msg == '导入完成') {
                                js.modal.hide("modal-import-debug");
                            }
                            js.table.refresh(table);
                            $this.attr('disabled', false);
                        }
                    }
                });
            })
        });
        /** 导入设计工时 */
        $("#btn-upload-designHours").click(function () {
            js.modal.confirm("尊敬的用户，导入数据会导致当前表数据被清空或无效，您确认要继续导入数据吗？", function () {
                var $this = $(this);
                $this.attr('disabled', true);
                js.validSubmit({
                    formId: "importDesignHoursForm",
                    url: ctx + "accountingInfo/designHoursImport",
                    data: new FormData($("#importDesignHoursForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.alert(result.msg);
                            if (result.msg == '导入完成') {
                                js.modal.hide("modal-import-design-hours");
                            }
                            js.table.refresh(table);
                            $this.attr('disabled', false);
                        }
                    }
                });
            })
        });
        /** 导入设计重量 */
        $("#btn-upload-designWeight").click(function () {
            js.modal.confirm("尊敬的用户，导入数据会导致当前表数据被清空或无效，您确认要继续导入数据吗？", function () {
                var $this = $(this);
                $this.attr('disabled', true);
                js.validSubmit({
                    formId: "importDesignWeightForm",
                    url: ctx + "accountingInfo/designWeightImport",
                    data: new FormData($("#importDesignWeightForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.alert(result.msg);
                            if (result.msg == '导入完成') {
                                js.modal.hide("modal-import-design-weight");
                            }
                            js.table.refresh(table1);
                            $this.attr('disabled', false);
                        }
                    }
                });
            })
        });
        /** 导入辅材 */
        $("#btn-upload-aux").click(function () {
            js.modal.confirm("尊敬的用户，导入数据会导致当前表数据被清空或无效，您确认要继续导入数据吗？", function () {
                var $this = $(this);
                $this.attr('disabled', true);
                js.validSubmit({
                    formId: "importAuxForm",
                    url: ctx + "accountingInfo/auxImport",
                    data: new FormData($("#importAuxForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.alert(result.msg);
                            if (result.msg == '导入完成') {
                                js.modal.hide("modal-import-aux");
                            }
                            js.table.refresh(table);
                            $this.attr('disabled', false);
                        }
                    }
                });
            })
        });
        /** 导入运输费 */
        $("#btn-upload-transport").click(function () {
            js.modal.confirm("尊敬的用户，导入数据会导致当前表数据被清空或无效，您确认要继续导入数据吗？", function () {
                var $this = $(this);
                $this.attr('disabled', true);
                js.validSubmit({
                    formId: "importTransportForm",
                    url: ctx + "accountingInfo/transportImport",
                    data: new FormData($("#importTransportForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.alert(result.msg);
                            if (result.msg == '导入完成') {
                                js.modal.hide("modal-import-transport");
                            }
                            js.table.refresh(table);
                            $this.attr('disabled', false);
                        }
                    }
                });
            })
        });
        /** 导入整体外协 */
        $("#btn-upload-whole").click(function () {
            js.modal.confirm("尊敬的用户，导入数据会导致当前表数据被清空或无效，您确认要继续导入数据吗？", function () {
                var $this = $(this);
                $this.attr('disabled', true);
                js.validSubmit({
                    formId: "importWholeForm",
                    url: ctx + "accountingInfo/wholeImport",
                    data: new FormData($("#importWholeForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.alert(result.msg);
                            if (result.msg == '导入完成') {
                                js.modal.hide("modal-import-whole");
                            }
                            js.table.refresh(table);
                            $this.attr('disabled', false);
                        }
                    }
                });
            })
        });
        /** 导入带料外协 */
        $("#btn-upload-withMat").click(function () {
            js.modal.confirm("尊敬的用户，导入数据会导致当前表数据被清空或无效，您确认要继续导入数据吗？", function () {
                var $this = $(this);
                $this.attr('disabled', true);
                js.validSubmit({
                    formId: "importwithMatForm",
                    url: ctx + "accountingInfo/withMatImport",
                    data: new FormData($("#importwithMatForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.alert(result.msg);
                            if (result.msg == '导入完成') {
                                js.modal.hide("modal-import-withMat");
                            }
                            js.table.refresh(table);
                            $this.attr('disabled', false);
                        }
                    }
                });
            })
        });
        /** 导入下料数据 */
        $("#btn-upload-cut").click(function () {
            js.modal.confirm("尊敬的用户，导入数据会导致当前表数据被清空或无效，您确认要继续导入数据吗？", function () {
                var $this = $(this);
                $this.attr('disabled', true);
                js.validSubmit({
                    formId: "importCutForm",
                    url: ctx + "accountingInfo/cutImport",
                    data: new FormData($("#importCutForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.alert(result.msg);
                            if (result.msg == '导入完成') {
                                js.modal.hide("modal-import-cut");
                            }
                            js.table.refresh(table);
                            if (table1 != undefined) {
                                js.table.refresh(table1);
                            }
                            $this.attr('disabled', false);
                        }
                    }
                });
            })
        });
        /** 导入包装工时数据 */
        $("#btn-upload-packing-hours").click(function () {
            js.modal.confirm("尊敬的用户，导入数据会导致当前表数据被清空或无效，您确认要继续导入数据吗？", function () {
                var $this = $(this);
                $this.attr('disabled', true);
                js.validSubmit({
                    formId: "importPackingHoursForm",
                    url: ctx + "accountingInfo/packingHoursImport",
                    data: new FormData($("#importPackingHoursForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.alert(result.msg);
                            if (result.msg == '导入完成') {
                                js.modal.hide("modal-import-packing-hours");
                            }
                            js.table.refresh(table);
                            if (table1 != undefined) {
                                js.table.refresh(table1);
                            }
                            $this.attr('disabled', false);
                        }
                    }
                });
            })
        });
        /** 导入包装辅材数据 */
        $("#btn-upload-packing-aux").click(function () {
            js.modal.confirm("尊敬的用户，导入数据会导致当前表数据被清空或无效，您确认要继续导入数据吗？", function () {
                var $this = $(this);
                $this.attr('disabled', true);
                js.validSubmit({
                    formId: "importPackingAuxForm",
                    url: ctx + "accountingInfo/packingAuxImport",
                    data: new FormData($("#importPackingAuxForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.alert(result.msg);
                            if (result.msg == '导入完成') {
                                js.modal.hide("modal-import-packing-aux");
                            }
                            js.table.refresh(table);
                            if (table1 != undefined) {
                                js.table.refresh(table1);
                            }
                            $this.attr('disabled', false);
                        }
                    }
                });
            })
        });
        /** 导入下料数据 */
        $("#btn-upload-heatTreatment").click(function () {
            js.modal.confirm("尊敬的用户，导入数据会导致当前表数据被清空或无效，您确认要继续导入数据吗？", function () {
                var $this = $(this);
                $this.attr('disabled', true);
                js.validSubmit({
                    formId: "importheatTreatmentForm",
                    url: ctx + "accountingInfo/heatTreatmentImport",
                    data: new FormData($("#importheatTreatmentForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.alert(result.msg);
                            if (result.msg == '导入完成') {
                                js.modal.hide("modal-import-heatTreatment");
                            }
                            js.table.refresh(table);
                            if (table1 != undefined) {
                                js.table.refresh(table1);
                            }
                            $this.attr('disabled', false);
                        }
                    }
                });
            })
        });
        /** 导入装配数据 */
        $("#btn-upload-assembly").click(function () {
            js.modal.confirm("尊敬的用户，导入数据会导致当前表数据被清空或无效，您确认要继续导入数据吗？", function () {
                var $this = $(this);
                $this.attr('disabled', true);
                js.validSubmit({
                    formId: "importAssemblyForm",
                    url: ctx + "accountingInfo/assemblyImport",
                    data: new FormData($("#importAssemblyForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.alert(result.msg);
                            if (result.msg == '导入完成') {
                                js.modal.hide("modal-import-assembly");
                            }
                            js.table.refresh(table);
                            if (table1 != undefined) {
                                js.table.refresh(table1);
                            }
                            $this.attr('disabled', false);
                        }
                    }
                });
            })
        });
        /** 导入喷涂数据 */
        $("#btn-upload-spray").click(function () {
            js.modal.confirm("尊敬的用户，导入数据会导致当前表数据被清空或无效，您确认要继续导入数据吗？", function () {
                var $this = $(this);
                $this.attr('disabled', true);
                js.validSubmit({
                    formId: "importSprayForm",
                    url: ctx + "accountingInfo/sprayImport",
                    data: new FormData($("#importSprayForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.alert(result.msg);
                            if (result.msg == '导入完成') {
                                js.modal.hide("modal-import-spray");
                            }
                            js.table.refresh(table);
                            if (table1 != undefined) {
                                js.table.refresh(table1);
                            }
                            $this.attr('disabled', false);
                        }
                    }
                });
            })
        });
        /** 导入铆焊数据 */
        $("#btn-upload-rivetAndSolder").click(function () {
            js.modal.confirm("尊敬的用户，导入数据会导致当前表数据被清空或无效，您确认要继续导入数据吗？", function () {
                var $this = $(this);
                $this.attr('disabled', true);
                js.validSubmit({
                    formId: "importRivetAndSolderForm",
                    url: ctx + "accountingInfo/rivetAndSolderImport",
                    data: new FormData($("#importRivetAndSolderForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.alert(result.msg);
                            js.modal.hide("modal-import-rivetAndSolder");
                            js.table.refresh(table);
                            if (table1 != undefined) {
                                js.table.refresh(table1);
                            }
                            $this.attr('disabled', false);
                        }
                    }
                });
            })
        });
        /** 导入机加数据 */
        $("#btn-upload-mac").click(function () {
            js.modal.confirm("尊敬的用户，导入数据会导致当前表数据被清空或无效，您确认要继续导入数据吗？", function () {
                var $this = $(this);
                $this.attr('disabled', true);
                js.validSubmit({
                    formId: "importMacForm",
                    url: ctx + "accountingInfo/macImport",
                    data: new FormData($("#importMacForm")[0]),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.alert(result.msg);
                            if (result.msg == '导入完成') {
                                js.modal.hide("modal-import-mac");
                            }
                            js.table.refresh(table);
                            if (table1 != undefined) {
                                js.table.refresh(table1);
                            }
                            $this.attr('disabled', false);
                        }
                    }
                });
            })
        });
        /** 下载导入失败excel */
        $("#download-error").click(function () {
            var that = $(this);
            js.post({
                url: ctx + "accountingInfo/exist",
                async: false,
                data: {
                    url: that.attr("data-url")
                },
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        that.attr("href", that.attr("data-url") + "?timeStamp=" + new Date().getTime());
                    } else {
                        js.modal.warning("没有需要处理的文件");
                    }
                }
            });
        });
        /** 下载导入失败excel */
        $("#download-error-cut-hours").click(function () {
            var that = $(this);
            js.post({
                url: ctx + "accountingInfo/exist",
                async: false,
                data: {
                    url: that.attr("data-url")
                },
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        that.attr("href", that.attr("data-url") + "?timeStamp=" + new Date().getTime());
                    } else {
                        js.modal.warning("没有需要处理的文件");
                    }
                }
            });
        });
        /** 下载导入失败excel */
        $("#download-error-packing-aux").click(function () {
            var that = $(this);
            js.post({
                url: ctx + "accountingInfo/exist",
                async: false,
                data: {
                    url: that.attr("data-url")
                },
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        that.attr("href", that.attr("data-url") + "?timeStamp=" + new Date().getTime());
                    } else {
                        js.modal.warning("没有需要处理的文件");
                    }
                }
            });
        });
        /** 下载导入失败excel */
        $("#download-error-pur").click(function () {
            var that = $(this);
            js.post({
                url: ctx + "accountingInfo/exist",
                async: false,
                data: {
                    url: that.attr("data-url")
                },
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        that.attr("href", that.attr("data-url") + "?timeStamp=" + new Date().getTime());
                    } else {
                        js.modal.warning("没有需要处理的文件");
                    }
                }
            });
        });
        /** 下载导入失败excel */
        $("#download-error-whole").click(function () {
            var that = $(this);
            js.post({
                url: ctx + "accountingInfo/exist",
                async: false,
                data: {
                    url: that.attr("data-url")
                },
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        that.attr("href", that.attr("data-url") + "?timeStamp=" + new Date().getTime());
                    } else {
                        js.modal.warning("没有需要处理的文件");
                    }
                }
            });
        });
        /** 下载导入失败excel */
        $("#download-error-packing-hours").click(function () {
            var that = $(this);
            js.post({
                url: ctx + "accountingInfo/exist",
                async: false,
                data: {
                    url: that.attr("data-url")
                },
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        that.attr("href", that.attr("data-url") + "?timeStamp=" + new Date().getTime());
                    } else {
                        js.modal.warning("没有需要处理的文件");
                    }
                }
            });
        });
        /** 下载导入失败excel */
        $("#download-error-withMat").click(function () {
            var that = $(this);
            js.post({
                url: ctx + "accountingInfo/exist",
                async: false,
                data: {
                    url: that.attr("data-url")
                },
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        that.attr("href", that.attr("data-url") + "?timeStamp=" + new Date().getTime());
                    } else {
                        js.modal.warning("没有需要处理的文件");
                    }
                }
            });
        });
        /** 下载导入失败excel */
        $("#download-error-install").click(function () {
            var that = $(this);
            js.post({
                url: ctx + "accountingInfo/exist",
                async: false,
                data: {
                    url: that.attr("data-url")
                },
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        that.attr("href", that.attr("data-url") + "?timeStamp=" + new Date().getTime());
                    } else {
                        js.modal.warning("没有需要处理的文件");
                    }
                }
            });
        });
        /** 下载导入失败excel */
        $("#download-error-debug").click(function () {
            var that = $(this);
            js.post({
                url: ctx + "accountingInfo/exist",
                async: false,
                data: {
                    url: that.attr("data-url")
                },
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        that.attr("href", that.attr("data-url") + "?timeStamp=" + new Date().getTime());
                    } else {
                        js.modal.warning("没有需要处理的文件");
                    }
                }
            });
        });
        /** 下载导入失败excel */
        $("#download-error-designHours").click(function () {
            var that = $(this);
            js.post({
                url: ctx + "accountingInfo/exist",
                async: false,
                data: {
                    url: that.attr("data-url")
                },
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        that.attr("href", that.attr("data-url") + "?timeStamp=" + new Date().getTime());
                    } else {
                        js.modal.warning("没有需要处理的文件");
                    }
                }
            });
        });
        /** 下载导入失败excel */
        $("#download-error-designWeight").click(function () {
            var that = $(this);
            js.post({
                url: ctx + "accountingInfo/exist",
                async: false,
                data: {
                    url: that.attr("data-url")
                },
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        that.attr("href", that.attr("data-url") + "?timeStamp=" + new Date().getTime());
                    } else {
                        js.modal.warning("没有需要处理的文件");
                    }
                }
            });
        });
        /** 下载导入失败excel */
        $("#download-error-aux").click(function () {
            var that = $(this);
            js.post({
                url: ctx + "accountingInfo/exist",
                async: false,
                data: {
                    url: that.attr("data-url")
                },
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        that.attr("href", that.attr("data-url") + "?timeStamp=" + new Date().getTime());
                    } else {
                        js.modal.warning("没有需要处理的文件");
                    }
                }
            });
        });

        /** 下载导入失败excel */
        $("#download-error-cut-aux").click(function () {
            var that = $(this);
            js.post({
                url: ctx + "accountingInfo/exist",
                async: false,
                data: {
                    url: that.attr("data-url")
                },
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        that.attr("href", that.attr("data-url") + "?timeStamp=" + new Date().getTime());
                    } else {
                        js.modal.warning("没有需要处理的文件");
                    }
                }
            });
        });
        /** 下载导入失败excel */
        $("#download-error-heatTreatment").click(function () {
            var that = $(this);
            js.post({
                url: ctx + "accountingInfo/exist",
                async: false,
                data: {
                    url: that.attr("data-url")
                },
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        that.attr("href", that.attr("data-url") + "?timeStamp=" + new Date().getTime());
                    } else {
                        js.modal.warning("没有需要处理的文件");
                    }
                }
            });
        });
        /** 下载导入失败excel */
        $("#download-error-assembly-hours").click(function () {
            var that = $(this);
            js.post({
                url: ctx + "accountingInfo/exist",
                async: false,
                data: {
                    url: that.attr("data-url")
                },
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        that.attr("href", that.attr("data-url") + "?timeStamp=" + new Date().getTime());
                    } else {
                        js.modal.warning("没有需要处理的文件");
                    }
                }
            });
        });
        /** 下载导入失败excel */
        $("#download-error-assembly-aux").click(function () {
            var that = $(this);
            js.post({
                url: ctx + "accountingInfo/exist",
                async: false,
                data: {
                    url: that.attr("data-url")
                },
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        that.attr("href", that.attr("data-url") + "?timeStamp=" + new Date().getTime());
                    } else {
                        js.modal.warning("没有需要处理的文件");
                    }
                }
            });
        });
        /** 下载导入失败excel */
        $("#download-error-spray-aux").click(function () {
            var that = $(this);
            js.post({
                url: ctx + "accountingInfo/exist",
                async: false,
                data: {
                    url: that.attr("data-url")
                },
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        that.attr("href", that.attr("data-url") + "?timeStamp=" + new Date().getTime());
                    } else {
                        js.modal.warning("没有需要处理的文件");
                    }
                }
            });
        });
        /** 下载导入失败excel */
        $("#download-error-spray-hours").click(function () {
            var that = $(this);
            js.post({
                url: ctx + "accountingInfo/exist",
                async: false,
                data: {
                    url: that.attr("data-url")
                },
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        that.attr("href", that.attr("data-url") + "?timeStamp=" + new Date().getTime());
                    } else {
                        js.modal.warning("没有需要处理的文件");
                    }
                }
            });
        });
        /** 下载导入失败excel */
        $("#download-error-RivetAndSolder-hours").click(function () {
            var that = $(this);
            js.post({
                url: ctx + "accountingInfo/exist",
                async: false,
                data: {
                    url: that.attr("data-url")
                },
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        that.attr("href", that.attr("data-url") + "?timeStamp=" + new Date().getTime());
                    } else {
                        js.modal.warning("没有需要处理的文件");
                    }
                }
            });
        });
        /** 下载导入失败excel */
        $("#download-error-RivetAndSolder-aux").click(function () {
            var that = $(this);
            js.post({
                url: ctx + "accountingInfo/exist",
                async: false,
                data: {
                    url: that.attr("data-url")
                },
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        that.attr("href", that.attr("data-url") + "?timeStamp=" + new Date().getTime());
                    } else {
                        js.modal.warning("没有需要处理的文件");
                    }
                }
            });
        });
        /** 下载导入失败excel */
        $("#download-error-transport").click(function () {
            var that = $(this);
            js.post({
                url: ctx + "accountingInfo/exist",
                async: false,
                data: {
                    url: that.attr("data-url")
                },
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        that.attr("href", that.attr("data-url") + "?timeStamp=" + new Date().getTime());
                    } else {
                        js.modal.warning("没有需要处理的文件");
                    }
                }
            });
        });

        /** 下载导入失败excel */
        $("#download-error-mac-hours").click(function () {
            var that = $(this);
            js.post({
                url: ctx + "accountingInfo/exist",
                async: false,
                data: {
                    url: that.attr("data-url")
                },
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        that.attr("href", that.attr("data-url") + "?timeStamp=" + new Date().getTime());
                    } else {
                        js.modal.warning("没有需要处理的文件");
                    }
                }
            });
        });
        /**
         * 批量有效
         */
        $("#btn-effective-batches").on('click', function (e) {
            changeIsEffectiveFlag('', 1);
        });
        /**
         * 批量无效
         */
        $("#btn-invalid-batches").on('click', function (e) {
            changeIsEffectiveFlag('', 2);
        });
        /**
         * 批量删除
         */
        $("#btn-remove-batches").on('click', function (e) {
            removeMat('');
        });
        /**
         * 清空数据
         */
        $("#btn-clear").on('click', function (e) {
            clearMat();
        });
        /**
         * 添加
         */
        $("#btn-add1").on('click', function (e) {
            let costCode = $("#queryForm [name='costCode']").val();
            if (costCode.indexOf('-设计费') > -1) {
                js.modal.open('modal-dsn-weight-add');
            } else if (costCode.indexOf('包装运输费-包装费') > -1) {
                js.modal.open('modal-packing-aux-add');
            }
        });
        /**
         * 添加
         */
        $("#btn-add").on('click', function (e) {
            $("#sprayTypeHours").hide();
            $("#sprayTypeAux").hide();
            let costCode = $("#queryForm [name='costCode']").val();
            if (costCode.indexOf('-材料费-材料采购费-') > -1) {
                js.modal.open('modal-mat-add');
            } else if (costCode.indexOf('-制造费-下料') > -1) {
                js.modal.open('modal-cut-add');
            } else if (costCode.indexOf('-制造费-铆焊') > -1) {
                js.modal.open('modal-cut-add');
            } else if (costCode.indexOf('-制造费-机加') > -1) {
                js.modal.open('modal-mac-add');
            } else if (costCode.indexOf('-制造费-喷涂') > -1) {
                $("#sprayTypeHours").show();
                $("#sprayTypeAux").show();
                js.modal.open('modal-cut-add');
            } else if (costCode.indexOf('-制造费-装配') > -1) {
                js.modal.open('modal-cut-add');
            } else if (costCode.indexOf('-制造费-热处理') > -1) {
                js.modal.open('modal-heatTreatment-add');
            } else if (costCode.indexOf('-外购费') > -1) {
                js.modal.open('modal-pur-add');
                $("#modal-pur-add .modal-title").text("外购件编辑");
            } else if (costCode.indexOf('-外协费-整体外协') > -1) {
                js.modal.open('modal-whole-add');
            } else if (costCode.indexOf('-外协费-带料外协') > -1) {
                js.modal.open('modal-whithMat-add');
            } else if (costCode.indexOf('-现场安装费-人工-安装人工') > -1) {
                js.modal.open('modal-install-add');
            } else if (costCode.indexOf('-现场安装费-人工-调试人工') > -1) {
                js.modal.open('modal-debug-add');
            } else if (costCode.indexOf('-现场安装费-辅材') > -1) {
                js.modal.open('modal-aux-add');
            } else if (costCode.indexOf('-设计费') > -1) {
                js.modal.open('modal-dsn-hours-add');
            } else if (costCode.indexOf('包装运输费-包装费') > -1) {
                js.modal.open('modal-packing-hours-add');
            } else if (costCode.indexOf('包装运输费-运输费') > -1) {
                js.modal.open('modal-transport-add');
            } else if (costCode.indexOf('备品备件') > -1) {
                js.modal.open('modal-pur-add');
                $("#modal-pur-add .modal-title").text("备品备件编辑");
            } else if (costCode.indexOf('随机备件') > -1) {
                js.modal.open('modal-pur-add');
                $("#modal-pur-add .modal-title").text("随机备件编辑");
            }
        });

        /**
         * 样机数据导出
         */
        $("#btn-prototype-export").on('click', function (e) {
            let code = $("#queryForm [name='costCode']").val();
            if (code.indexOf('-材料费-材料采购费-') > -1) {
                if (code.indexOf('-铝材') == -1) {
                    $("#queryForm").attr("action", ctx + "estimateManage/matExport");
                    $("#queryForm").submit();
                    $("#queryForm").removeAttr("action");
                    js.modal.loading("正在导出，请稍候...");
                } else if (code.indexOf('-铝材') > -1) {
                    $("#queryForm").attr("action", ctx + "estimateManage/aluExport");
                    $("#queryForm").submit();
                    $("#queryForm").removeAttr("action");
                    js.modal.loading("正在导出，请稍候...");
                }
            } else if (code.indexOf('-制造费-下料') > -1) {
                // 下载第一个文件
                window.open(ctx + "estimateManage/cutExport" + "?id=" + $("#queryForm [name='id']").val());
                // 下载第二个文件附表
                location.href = ctx + "estimateManage/cutAuxExport" + "?id=" + $("#queryForm [name='id']").val();
            } else if (code.indexOf('-制造费-铆焊') > -1) {
                // 下载第一个文件
                window.open(ctx + "estimateManage/rivetAndSolderExport" + "?id=" + $("#queryForm [name='id']").val());
                // 下载第二个文件附表
                location.href = ctx + "estimateManage/rivetAndSolderAuxExport" + "?id=" + $("#queryForm [name='id']").val();
            } else if (code.indexOf('-制造费-机加') > -1) {
                window.open(ctx + "estimateManage/macHoursExport" + "?id=" + $("#queryForm [name='id']").val());
            } else if (code.indexOf('-制造费-喷涂') > -1) {
                // 下载第一个文件
                window.open(ctx + "estimateManage/sprayExport" + "?id=" + $("#queryForm [name='id']").val());
                // 下载第二个文件附表
                location.href = ctx + "estimateManage/sprayAuxExport" + "?id=" + $("#queryForm [name='id']").val();
            } else if (code.indexOf('-制造费-装配') > -1) {
                // 下载第一个文件
                window.open(ctx + "estimateManage/assemblyExport" + "?id=" + $("#queryForm [name='id']").val());
                // 下载第二个文件附表
                location.href = ctx + "estimateManage/assemblyAuxExport" + "?id=" + $("#queryForm [name='id']").val();
            } else if (code.indexOf('-制造费-热处理') > -1) {
                window.open(ctx + "estimateManage/heatTreatmentExport" + "?id=" + $("#queryForm [name='id']").val());
            } else if (code.indexOf('-外购费') > -1 || code.indexOf('备品备件') > -1 || code.indexOf('随机备件') > -1) {
                window.open(ctx + "estimateManage/purExport" + "?id=" + $("#queryForm [name='id']").val());
            } else if (code.indexOf('-整体外协') > -1) {
                window.open(ctx + "estimateManage/wholeExport" + "?id=" + $("#queryForm [name='id']").val());
            } else if (code.indexOf('-带料外协') > -1) {
                window.open(ctx + "estimateManage/withMatExport" + "?id=" + $("#queryForm [name='id']").val());
            } else if (code.indexOf('-现场安装费-人工-安装人工') > -1) {
                window.open(ctx + "estimateManage/installExport" + "?id=" + $("#queryForm [name='id']").val());
            } else if (code.indexOf('-现场安装费-人工-调试人工') > -1) {
                window.open(ctx + "estimateManage/debugExport" + "?id=" + $("#queryForm [name='id']").val());
            } else if (code.indexOf('-现场安装费-辅材') > -1) {
                window.open(ctx + "estimateManage/auxExport" + "?id=" + $("#queryForm [name='id']").val());
            } else if (code.indexOf('-设计费') > -1) {
                // 下载第一个文件
                window.open(ctx + "estimateManage/designExport" + "?id=" + $("#queryForm [name='id']").val());
                // 下载第二个文件附表
                location.href = ctx + "estimateManage/designWeightExport" + "?id=" + $("#queryForm [name='id']").val();
            } else if (code.indexOf('包装运输费-包装费') > -1) {
                // 下载第一个文件
                window.open(ctx + "estimateManage/packingExport" + "?id=" + $("#queryForm [name='id']").val());
                // 下载第二个文件附表
                location.href = ctx + "estimateManage/packingAuxExport" + "?id=" + $("#queryForm [name='id']").val();
            } else if (code.indexOf("包装运输费-运输费") > -1) {
                window.open(ctx + "estimateManage/transportExport" + "?id=" + $("#queryForm [name='id']").val());
            }
            js.modal.loading("正在导出，请稍候...");
            setTimeout(function () {
                js.modal.closeLoading();
            }, 5000);
        });
        /**
         * 打开样机数据导入模态框
         */
        $("#btn-valid-data-import1").on('click', function (e) {
            let code = $("#queryForm [name='costCode']").val();
            if (code.indexOf('-设计费') > -1) {
                js.modal.open('modal-import-design-weight');
            } else if (code.indexOf('包装运输费-包装费') > -1) {
                js.modal.open('modal-import-packing-aux');
            }
        });
        /**
         * 打开样机数据导入模态框
         */
        $("#btn-valid-data-import").on('click', function (e) {
            let code = $("#queryForm [name='costCode']").val();
            if (code.indexOf('-材料费-材料采购费-') > -1) {
                if (code.indexOf('-铝材')) {
                    $("#a-xlsxTemplate").attr('href', '/file/概算铝材计划模板.xlsx');
                } else {
                    $("#a-xlsxTemplate").attr('href', '/file/原材料计划模板.xlsx');
                }
                js.modal.open('modal-import');
            } else if (code.indexOf('-制造费-下料') > -1) {
                js.modal.open('modal-import-cut');
            } else if (code.indexOf('-制造费-铆焊') > -1) {
                js.modal.open('modal-import-rivetAndSolder');
            } else if (code.indexOf('-制造费-机加') > -1) {
                js.modal.open('modal-import-mac');
            } else if (code.indexOf('-制造费-喷涂') > -1) {
                js.modal.open('modal-import-spray');
            } else if (code.indexOf('-制造费-装配') > -1) {
                js.modal.open('modal-import-assembly');
            } else if (code.indexOf('-制造费-热处理') > -1) {
                js.modal.open('modal-import-heatTreatment');
            } else if (code.indexOf('-外购费') > -1 || code.indexOf('备品备件') > -1 || code.indexOf('随机备件') > -1) {
                js.modal.open('modal-import-pur');
            } else if (code.indexOf('-外协费-整体外协') > -1) {
                js.modal.open('modal-import-whole');
            } else if (code.indexOf('-外协费-带料外协') > -1) {
                js.modal.open('modal-import-withMat');
            } else if (code.indexOf('-现场安装费-人工-安装人工') > -1) {
                js.modal.open('modal-import-install');
            } else if (code.indexOf('-现场安装费-人工-调试人工') > -1) {
                js.modal.open('modal-import-debug');
            } else if (code.indexOf('-现场安装费-辅材') > -1) {
                js.modal.open('modal-import-aux');
            } else if (code.indexOf('-设计费') > -1) {
                js.modal.open('modal-import-design-hours');
            } else if (code.indexOf('包装运输费-包装费') > -1) {
                js.modal.open('modal-import-packing-hours');
            } else if (code.indexOf('包装运输费-运输费') > -1) {
                js.modal.open('modal-import-transport');
            }
        })
    })
    ;

    /**
     * 加载参数
     */
    function initParam() {
        let code = $("#queryForm [name='costCode']").val();
        if (code.indexOf("-制造费-") > -1 || code.indexOf("包装运输费-包装费") > -1) {
            //获取忠旺机械人均工资
            js.post({
                url: ctx + 'accountingInfo/getConfigParam',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: {
                    batId: $("#queryForm [name='batId']").val(),
                    code: 'Average daily wage per capita of Zhongwang machinery'
                },
                async: true,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        $("#input_avg_mac").val(result.data.value);
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        } else if (code.indexOf("-现场安装费-人工-安装人工") > -1 || code.indexOf("-现场安装费-人工-调试人工") > -1) {
            //获取现场安装调试人均工资
            js.post({
                url: ctx + 'accountingInfo/getConfigParam',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: {
                    batId: $("#queryForm [name='batId']").val(),
                    code: 'Per capita wage of site installation'
                },
                async: true,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        $("#input_install_debug").val(result.data.value);
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        } else if (code.indexOf("-设计费") > -1) {
            //获取设计人均工资
            js.post({
                url: ctx + 'accountingInfo/getConfigParam',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: {
                    batId: $("#queryForm [name='batId']").val(),
                    code: 'Design per capita daily wage'
                },
                async: true,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        $("#input_avg_dsn").val(result.data.value);
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        }
        if (code.indexOf('包装运输费-运输费') == -1) {
            //获取税率
            js.post({
                url: ctx + 'accountingInfo/getTax',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: {
                    batId: $("#queryForm [name='batId']").val()
                },
                async: true,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        $("#input_tax").val(result.data.value + "%");
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        } else {
            //获取运输税率
            js.post({
                url: ctx + 'accountingInfo/getConfigParam',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: {
                    batId: $("#queryForm [name='batId']").val(),
                    code: 'freight tax'
                },
                async: true,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        $("#input_tax").val(result.data.value + "%");
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        }

    }

    /**
     * 加载列表数据
     */
    function initItemList() {
        let costParentCode = $("#queryForm [name='costParentCode']").val();
        let costCode = $("#queryForm [name='costCode']").val();
        if (costParentCode.indexOf("-材料费-材料采购费") > -1 && costCode.indexOf("-材料费-材料采购费-铝材") == -1) {
            table = js.table.init({
                id: "bootstrap-table",
                queryForm: 'queryForm',
                url: ctx + "estimateManage/rawMaterialList",
                showColumns: true,
                showExport: true,
                pagination: true,                                   // 是否显示分页
                toolbar: '#toolBar',
                uniqueId: "id",
                columns: [
                    {
                        checkbox: true,
                        width: '30px'
                    },
                    {
                        title: '序号', field: 'id', width: '60',
                        formatter: function (value, row, index) {
                            return index + 1;
                        }
                    },
                    {title: '部分', field: 'part', width: '120'},
                    {title: '专业', field: 'major'},
                    {title: '提报计划物料描述', field: 'matDesc', width: '200'},
                    {title: '材质', field: 'texture', width: '80'},
                    {title: '实用数量', field: 'num'},
                    {title: '单位', field: 'unit', width: '50'},
                    {title: '备注', field: 'remark'},
                    {title: 'SAP物料编码', field: 'sapCode', width: '95'},
                    {title: '采购物料描述', field: 'buyMatDesc', width: '200'},
                    {title: '单价', field: 'price'},
                    {
                        title: '总价',
                        formatter: function (value, row, index) {
                            return (row.price * row.num).toFixed(2);
                        }
                    },
                    {
                        title: '金额来源', field: 'priceType', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">系统获取</label>';
                            } else if (value === 2) {
                                return '<label class="badge label-warning">人工编辑</label>';
                            }
                        }
                    },
                    {
                        title: '数据类型', field: 'isPrototypeDataFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">样机数据</label>';
                            } else {
                                return '<label class="badge label-warning">导入数据</label>';
                            }
                        }
                    },
                    {
                        title: '数据状态', field: 'isEffectiveFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">有效</label>';
                            } else {
                                return '<label class="badge label-danger">无效</label>';
                            }
                        }
                    },
                    {
                        title: '操作',
                        formatter: function (value, row, index) {
                            let elements = new Array();
                            if (hasP('rou:adjust:edit')) {
                                let mode = $("#mode").val();
                                let finishStatus = $("#queryForm [name='finishStatus']").val();

                                if (mode === 'edit' && finishStatus != 3) {
                                    elements.push('<button style="width: 48px;" class="btn btn-warning btn-xs" onclick="showEditPanel(' + row.id + ')">编辑</button>');
                                    if (row.isEffectiveFlag === 1) {
                                        elements.push('<button style="width: 48px;border-color: #985f0d;border-top-color: rgb(152, 95, 13);border-right-color: rgb(152, 95, 13);border-bottom-color: rgb(152, 95, 13);border-left-color: rgb(152, 95, 13)" class="btn bg-orange btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 2 + ')">无效</button>');

                                    } else if (row.isEffectiveFlag === 2) {
                                        elements.push('<button style="width: 48px" class="btn btn-success btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 1 + ')">有效</button>');
                                        if (mode === 'edit' && finishStatus != 3 && row.isPrototypeDataFlag != 1) {
                                            elements.push('<button style="width: 48px" class="btn btn-danger btn-xs" onclick="removeMat(' + row.id + ')">删除</button>');
                                        }
                                    }
                                }
                            }
                            return elements.join('');
                        }
                    }

                ]
            });
        } else if (costParentCode.indexOf("-材料费-材料采购费") > -1 && costCode.indexOf("-材料费-材料采购费-铝材") > -1) {
            table = js.table.init({
                id: "bootstrap-table",
                queryForm: 'queryForm',
                url: ctx + "estimateManage/rawMaterialList",
                showColumns: true,
                showExport: true,
                pagination: true,                                   // 是否显示分页
                toolbar: '#toolBar',
                uniqueId: "id",
                columns: [
                    {
                        checkbox: true,
                        width: '30px'
                    },
                    {
                        title: '序号', field: 'id', width: '60',
                        formatter: function (value, row, index) {
                            return index + 1;
                        }
                    },
                    {title: '部分', field: 'part', width: '120'},
                    {title: '专业', field: 'major'},
                    {title: '型材图号', field: 'matDesc', width: '200'},
                    {title: '材质', field: 'texture', width: '80'},
                    {title: '理论总重', field: 'num'},
                    {title: '单位', field: 'unit', width: '50'},
                    {title: '备注', field: 'remark'},
                    {title: '单价', field: 'price'},
                    {
                        title: '总价',
                        formatter: function (value, row, index) {
                            return (row.price * row.num).toFixed(2);
                        }
                    },
                    {
                        title: '金额来源', field: 'priceType', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">系统获取</label>';
                            } else if (value === 2) {
                                return '<label class="badge label-warning">人工编辑</label>';
                            }
                        }
                    },
                    {
                        title: '数据类型', field: 'isPrototypeDataFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">样机数据</label>';
                            } else {
                                return '<label class="badge label-warning">导入数据</label>';
                            }
                        }
                    },
                    {
                        title: '数据状态', field: 'isEffectiveFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">有效</label>';
                            } else {
                                return '<label class="badge label-danger">无效</label>';
                            }
                        }
                    },
                    {
                        title: '操作',
                        formatter: function (value, row, index) {
                            let elements = new Array();
                            if (hasP('rou:adjust:edit')) {
                                let mode = $("#mode").val();
                                let finishStatus = $("#queryForm [name='finishStatus']").val();

                                if (mode === 'edit' && finishStatus != 3) {
                                    elements.push('<button style="width: 48px;" class="btn btn-warning btn-xs" onclick="showEditPanel(' + row.id + ')">编辑</button>');
                                    if (row.isEffectiveFlag === 1) {
                                        elements.push('<button style="width: 48px;border-color: #985f0d;border-top-color: rgb(152, 95, 13);border-right-color: rgb(152, 95, 13);border-bottom-color: rgb(152, 95, 13);border-left-color: rgb(152, 95, 13)" class="btn bg-orange btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 2 + ')">无效</button>');

                                    } else if (row.isEffectiveFlag === 2) {
                                        elements.push('<button style="width: 48px" class="btn btn-success btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 1 + ')">有效</button>');
                                        if (mode === 'edit' && finishStatus != 3 && row.isPrototypeDataFlag != 1) {
                                            elements.push('<button style="width: 48px" class="btn btn-danger btn-xs" onclick="removeMat(' + row.id + ')">删除</button>');
                                        }
                                    }
                                }
                            }
                            return elements.join('');
                        }
                    }

                ]
            });
        } else if (costParentCode.indexOf("-制造费") > -1) {
            if (costCode.indexOf("-下料") > -1) {
                table = js.table.init({
                    id: "bootstrap-table",
                    queryForm: 'queryForm',
                    url: ctx + "estimateManage/workingHoursOrAuxiliaryList",
                    showColumns: true,
                    showExport: true,
                    pagination: true,                                   // 是否显示分页
                    toolbar: '#toolBar',
                    uniqueId: "id",
                    queryParams: function (params) {
                        let curParams = {
                            // 传递参数查询参数
                            pageSize: params.limit,
                            pageNum: params.offset / params.limit + 1,
                            sort: params.sort,
                            order: params.order,
                            dataType: '工时'
                        };
                        return $.extend(curParams, this.queryData, js.formToJSON(this.queryForm));
                    },
                    onLoadSuccess: function (data) {
                    },
                    columns: [
                        {
                            checkbox: true,
                            width: '30px'
                        },
                        {
                            title: '序号', field: 'id', width: '60',
                            formatter: function (value, row, index, field) {
                                var pageSize = table.bootstrapTable('getOptions').pageSize;
                                var pageNumber = table.bootstrapTable('getOptions').pageNumber;
                                return pageSize * (pageNumber - 1) + index + 1;
                            }
                        },
                        {title: '部分', field: 'part', width: '120'},
                        {title: '专业', field: 'major'},
                        {title: '下料工时类别', field: 'laborName', width: '200'},
                        {title: '数量', field: 'laborNum'},
                        {title: '单位', field: 'unit', width: '50'},
                        {
                            title: '成本金额',
                            formatter: function (value, row) {
                                return row.laborNum * $("#input_avg_mac").val();
                            }
                        },
                        {title: '备注', field: 'remark'}
                        ,
                        {
                            title: '金额来源', field: 'priceType', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">系统获取</label>';
                                } else if (value === 2) {
                                    return '<label class="badge label-warning">人工编辑</label>';
                                }
                            }
                        },
                        {
                            title: '数据类型', field: 'isPrototypeDataFlag', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">样机数据</label>';
                                } else {
                                    return '<label class="badge label-warning">导入数据</label>';
                                }
                            }
                        },
                        {
                            title: '数据状态', field: 'isEffectiveFlag', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">有效</label>';
                                } else {
                                    return '<label class="badge label-danger">无效</label>';
                                }
                            }
                        },
                        {
                            title: '操作',
                            formatter: function (value, row, index) {
                                let elements = new Array();
                                if (hasP('rou:adjust:edit')) {
                                    let mode = $("#mode").val();
                                    let finishStatus = $("#queryForm [name='finishStatus']").val();
                                    if (mode === 'edit' && finishStatus != 3) {
                                        elements.push('<button style="width: 48px;" class="btn btn-warning btn-xs" onclick="showEditPanel(' + row.id + ')">编辑</button>');
                                        if (row.isEffectiveFlag === 1) {
                                            elements.push('<button style="width: 48px;border-color: #985f0d;border-top-color: rgb(152, 95, 13);border-right-color: rgb(152, 95, 13);border-bottom-color: rgb(152, 95, 13);border-left-color: rgb(152, 95, 13)" class="btn bg-orange btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 2 + ')">无效</button>');

                                        } else if (row.isEffectiveFlag === 2) {
                                            elements.push('<button style="width: 48px" class="btn btn-success btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 1 + ')">有效</button>');
                                            if (mode === 'edit' && finishStatus != 3 && row.isPrototypeDataFlag != 1) {
                                                elements.push('<button style="width: 48px" class="btn btn-danger btn-xs" onclick="removeMat(' + row.id + ')">删除</button>');
                                            }
                                        }
                                    }
                                }
                                return elements.join('');
                            }
                        }
                    ]
                });
                $("#queryForm [name='auxiliaryMaterials']").val(true);
                table1 = js.table.init({
                    id: "bootstrap-table1",
                    queryForm: 'queryForm',
                    url: ctx + "estimateManage/workingHoursOrAuxiliaryList",
                    showColumns: true,
                    showExport: true,
                    pagination: true,                                   // 是否显示分页
                    uniqueId: "id",
                    queryParams: function (params) {
                        let curParams = {
                            // 传递参数查询参数
                            pageSize: params.limit,
                            pageNum: params.offset / params.limit + 1,
                            sort: params.sort,
                            order: params.order,
                            dataType: '辅材'
                        };
                        return $.extend(curParams, this.queryData, js.formToJSON(this.queryForm));
                    },
                    columns: [
                        {
                            checkbox: true,
                            width: '30px'
                        },
                        {
                            title: '序号', field: 'id', width: '60',
                            formatter: function (value, row, index, field) {
                                var pageSize = table1.bootstrapTable('getOptions').pageSize;
                                var pageNumber = table1.bootstrapTable('getOptions').pageNumber;
                                return pageSize * (pageNumber - 1) + index + 1;
                            }
                        },
                        {title: '部分', field: 'part', width: '120'},
                        {title: '专业', field: 'major'},
                        {title: '主要辅材类别', field: 'laborName', width: '200'},
                        {title: '主要辅材用量', field: 'laborNum'},
                        {title: '单位', field: 'unit', width: '50'},
                        {title: '单价', field: 'price'},
                        {
                            title: '成本金额',
                            formatter: function (value, row, index) {
                                return row.laborNum * row.price;
                            }
                        },
                        {title: '备注', field: 'remark'}
                        ,
                        {
                            title: '金额来源', field: 'priceType', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">系统获取</label>';
                                } else if (value === 2) {
                                    return '<label class="badge label-warning">人工编辑</label>';
                                }
                            }
                        },
                        {
                            title: '数据类型', field: 'isPrototypeDataFlag', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">样机数据</label>';
                                } else {
                                    return '<label class="badge label-warning">导入数据</label>';
                                }
                            }
                        },
                        {
                            title: '数据状态', field: 'isEffectiveFlag', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">有效</label>';
                                } else {
                                    return '<label class="badge label-danger">无效</label>';
                                }
                            }
                        },
                        {
                            title: '操作',
                            formatter: function (value, row, index) {
                                let elements = new Array();
                                if (hasP('rou:adjust:edit')) {
                                    let mode = $("#mode").val();
                                    let finishStatus = $("#queryForm [name='finishStatus']").val();

                                    if (mode === 'edit' && finishStatus != 3) {
                                        elements.push('<button style="width: 48px;" class="btn btn-warning btn-xs" onclick="showEditPanel(' + row.id + ')">编辑</button>');
                                        if (row.isEffectiveFlag === 1) {
                                            elements.push('<button style="width: 48px;border-color: #985f0d;border-top-color: rgb(152, 95, 13);border-right-color: rgb(152, 95, 13);border-bottom-color: rgb(152, 95, 13);border-left-color: rgb(152, 95, 13)" class="btn bg-orange btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 2 + ')">无效</button>');

                                        } else if (row.isEffectiveFlag === 2) {
                                            elements.push('<button style="width: 48px" class="btn btn-success btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 1 + ')">有效</button>');
                                            if (mode === 'edit' && finishStatus != 3 && row.isPrototypeDataFlag != 1) {
                                                elements.push('<button style="width: 48px" class="btn btn-danger btn-xs" onclick="removeMat(' + row.id + ')">删除</button>');
                                            }
                                        }
                                    }
                                }
                                return elements.join('');
                            }
                        }
                    ]
                });
            } else if (costCode.indexOf("-铆焊") > -1) {
                table = js.table.init({
                    id: "bootstrap-table",
                    queryForm: 'queryForm',
                    url: ctx + "estimateManage/workingHoursOrAuxiliaryList",
                    showColumns: true,
                    showExport: true,
                    pagination: true,                                   // 是否显示分页
                    toolbar: '#toolBar',
                    uniqueId: "id",
                    queryParams: function (params) {
                        let curParams = {
                            // 传递参数查询参数
                            pageSize: params.limit,
                            pageNum: params.offset / params.limit + 1,
                            sort: params.sort,
                            order: params.order,
                            dataType: '工时'
                        };
                        return $.extend(curParams, this.queryData, js.formToJSON(this.queryForm));
                    },
                    onLoadSuccess: function (data) {
                    },
                    columns: [
                        {
                            checkbox: true,
                            width: '30px'
                        },
                        {
                            title: '序号', field: 'id', width: '60',
                            formatter: function (value, row, index, field) {
                                var pageSize = table.bootstrapTable('getOptions').pageSize;
                                var pageNumber = table.bootstrapTable('getOptions').pageNumber;
                                return pageSize * (pageNumber - 1) + index + 1;
                            }
                        },
                        {title: '部分', field: 'part', width: '120'},
                        {title: '专业', field: 'major'},
                        {title: '铆焊工时类别', field: 'laborName', width: '200'},
                        {title: '数量', field: 'laborNum'},
                        {title: '单位', field: 'unit', width: '50'},
                        {
                            title: '成本金额',
                            formatter: function (value, row) {
                                return row.laborNum * $("#input_avg_mac").val();
                            }
                        },
                        {title: '备注', field: 'remark'}
                        ,
                        {
                            title: '金额来源', field: 'priceType', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">系统获取</label>';
                                } else if (value === 2) {
                                    return '<label class="badge label-warning">人工编辑</label>';
                                }
                            }
                        },
                        {
                            title: '数据类型', field: 'isPrototypeDataFlag', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">样机数据</label>';
                                } else {
                                    return '<label class="badge label-warning">导入数据</label>';
                                }
                            }
                        },
                        {
                            title: '数据状态', field: 'isEffectiveFlag', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">有效</label>';
                                } else {
                                    return '<label class="badge label-danger">无效</label>';
                                }
                            }
                        },
                        {
                            title: '操作',
                            formatter: function (value, row, index) {
                                let elements = new Array();
                                if (hasP('rou:adjust:edit')) {
                                    let mode = $("#mode").val();
                                    let finishStatus = $("#queryForm [name='finishStatus']").val();
                                    if (mode === 'edit' && finishStatus != 3) {
                                        elements.push('<button style="width: 48px;" class="btn btn-warning btn-xs" onclick="showEditPanel(' + row.id + ')">编辑</button>');
                                        if (row.isEffectiveFlag === 1) {
                                            elements.push('<button style="width: 48px;border-color: #985f0d;border-top-color: rgb(152, 95, 13);border-right-color: rgb(152, 95, 13);border-bottom-color: rgb(152, 95, 13);border-left-color: rgb(152, 95, 13)" class="btn bg-orange btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 2 + ')">无效</button>');

                                        } else if (row.isEffectiveFlag === 2) {
                                            elements.push('<button style="width: 48px" class="btn btn-success btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 1 + ')">有效</button>');
                                            if (mode === 'edit' && finishStatus != 3 && row.isPrototypeDataFlag != 1) {
                                                elements.push('<button style="width: 48px" class="btn btn-danger btn-xs" onclick="removeMat(' + row.id + ')">删除</button>');
                                            }
                                        }
                                    }
                                }
                                return elements.join('');
                            }
                        }
                    ]
                });
                $("#queryForm [name='auxiliaryMaterials']").val(true);
                table1 = js.table.init({
                    id: "bootstrap-table1",
                    queryForm: 'queryForm',
                    url: ctx + "estimateManage/workingHoursOrAuxiliaryList",
                    showColumns: true,
                    showExport: true,
                    pagination: true,                                   // 是否显示分页
                    uniqueId: "id",
                    queryParams: function (params) {
                        let curParams = {
                            // 传递参数查询参数
                            pageSize: params.limit,
                            pageNum: params.offset / params.limit + 1,
                            sort: params.sort,
                            order: params.order,
                            dataType: '辅材'
                        };
                        return $.extend(curParams, this.queryData, js.formToJSON(this.queryForm));
                    },
                    columns: [
                        {
                            checkbox: true,
                            width: '30px'
                        },
                        {
                            title: '序号', field: 'id', width: '60',
                            formatter: function (value, row, index, field) {
                                var pageSize = table1.bootstrapTable('getOptions').pageSize;
                                var pageNumber = table1.bootstrapTable('getOptions').pageNumber;
                                return pageSize * (pageNumber - 1) + index + 1;
                            }
                        },
                        {title: '部分', field: 'part', width: '120'},
                        {title: '专业', field: 'major'},
                        {title: '主要辅材类别', field: 'laborName', width: '200'},
                        {title: '主要辅材用量', field: 'laborNum'},
                        {title: '单位', field: 'unit', width: '50'},
                        {title: '单价', field: 'price'},
                        {
                            title: '成本金额',
                            formatter: function (value, row, index) {
                                return row.laborNum * row.price;
                            }
                        },
                        {title: '备注', field: 'remark'}
                        ,
                        {
                            title: '金额来源', field: 'priceType', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">系统获取</label>';
                                } else if (value === 2) {
                                    return '<label class="badge label-warning">人工编辑</label>';
                                }
                            }
                        },
                        {
                            title: '数据类型', field: 'isPrototypeDataFlag', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">样机数据</label>';
                                } else {
                                    return '<label class="badge label-warning">导入数据</label>';
                                }
                            }
                        },
                        {
                            title: '数据状态', field: 'isEffectiveFlag', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">有效</label>';
                                } else {
                                    return '<label class="badge label-danger">无效</label>';
                                }
                            }
                        },
                        {
                            title: '操作',
                            formatter: function (value, row, index) {
                                let elements = new Array();
                                if (hasP('rou:adjust:edit')) {
                                    let mode = $("#mode").val();
                                    let finishStatus = $("#queryForm [name='finishStatus']").val();

                                    if (mode === 'edit' && finishStatus != 3) {
                                        elements.push('<button style="width: 48px;" class="btn btn-warning btn-xs" onclick="showEditPanel(' + row.id + ')">编辑</button>');
                                        if (row.isEffectiveFlag === 1) {
                                            elements.push('<button style="width: 48px;border-color: #985f0d;border-top-color: rgb(152, 95, 13);border-right-color: rgb(152, 95, 13);border-bottom-color: rgb(152, 95, 13);border-left-color: rgb(152, 95, 13)" class="btn bg-orange btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 2 + ')">无效</button>');

                                        } else if (row.isEffectiveFlag === 2) {
                                            elements.push('<button style="width: 48px" class="btn btn-success btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 1 + ')">有效</button>');
                                            if (mode === 'edit' && finishStatus != 3 && row.isPrototypeDataFlag != 1) {
                                                elements.push('<button style="width: 48px" class="btn btn-danger btn-xs" onclick="removeMat(' + row.id + ')">删除</button>');
                                            }
                                        }
                                    }
                                }
                                return elements.join('');
                            }
                        }
                    ]
                });
            } else if (costCode.indexOf("-机加") > -1) {
                table = js.table.init({
                    id: "bootstrap-table",
                    queryForm: 'queryForm',
                    url: ctx + "estimateManage/workingHoursOrAuxiliaryList",
                    showColumns: true,
                    showExport: true,
                    pagination: true,                                   // 是否显示分页
                    toolbar: '#toolBar',
                    uniqueId: "id",
                    queryParams: function (params) {
                        let curParams = {
                            // 传递参数查询参数
                            pageSize: params.limit,
                            pageNum: params.offset / params.limit + 1,
                            sort: params.sort,
                            order: params.order,
                            dataType: '工时'
                        };
                        return $.extend(curParams, this.queryData, js.formToJSON(this.queryForm));
                    },
                    onLoadSuccess: function (data) {
                        // $("#macToolLabel1").show();
                        // $("#macToolLabel2").show();
                        // $("#macToolLabel3").show();
                        // $("#macToolLabel4").show();
                        // $("#macToolLabel5").show();
                        // $("#macToolLabel6").show();
                        // $("#macToolLabel7").show();
                        // $("#macToolLabel8").show();
                        // $("#macToolLabel9").show();
                        // $("#macToolLabel10").show();
                        // $("#macToolLabel11").show();
                        // $("#macToolLabel12").show();
                        $("#lbl_tax_amount").text("总金额：");
                        $("#lbl-tax1").hide();
                        $("#lbl-tax2").hide();
                        $("#lbl_avg_mac1").hide();
                        $("#lbl_avg_mac2").hide();
                        $("#lbl_avg_mac3").hide();
                        $("#lbl_amount1").hide();
                        $("#lbl_amount2").hide();
                        $("#lbl_amount3").hide();
                    },
                    columns: [
                        {
                            checkbox: true,
                            width: '30px'
                        },
                        {
                            title: '序号', field: 'id', width: '60',
                            formatter: function (value, row, index, field) {
                                var pageSize = table.bootstrapTable('getOptions').pageSize;
                                var pageNumber = table.bootstrapTable('getOptions').pageNumber;
                                return pageSize * (pageNumber - 1) + index + 1;
                            }
                        },
                        {title: '部分', field: 'part', width: '120'},
                        {title: '专业', field: 'major'},
                        {title: '图号', field: 'diagram', width: '200'},
                        {title: '图纸名称', field: 'drawingNo', width: '200'},
                        {title: '数量', field: 'num'},
                        {title: '工序', field: 'process'},
                        {title: '设备类型', field: 'nameType'},
                        {title: '设备型号/名称', field: 'name'},
                        {title: '工时（小时）', field: 'workHoursStr'},
                        {title: '工时（分钟）', field: 'workMinuteStr'},
                        {title: '定额', field: 'price'},
                        {title: '总金额', field: 'totalPrice'},
                        {
                            title: '数据类型', field: 'isPrototypeDataFlag', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">样机数据</label>';
                                } else {
                                    return '<label class="badge label-warning">导入数据</label>';
                                }
                            }
                        },
                        {
                            title: '数据状态', field: 'isEffectiveFlag', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">有效</label>';
                                } else {
                                    return '<label class="badge label-danger">无效</label>';
                                }
                            }
                        },
                        {
                            title: '操作',
                            formatter: function (value, row, index) {
                                let elements = new Array();
                                if (hasP('rou:adjust:edit')) {
                                    let mode = $("#mode").val();
                                    let finishStatus = $("#queryForm [name='finishStatus']").val();
                                    if (mode === 'edit' && finishStatus != 3) {
                                        elements.push('<button style="width: 48px;" class="btn btn-warning btn-xs" onclick="showEditPanel(' + row.id + ')">编辑</button>');
                                        if (row.isEffectiveFlag === 1) {
                                            elements.push('<button style="width: 48px;border-color: #985f0d;border-top-color: rgb(152, 95, 13);border-right-color: rgb(152, 95, 13);border-bottom-color: rgb(152, 95, 13);border-left-color: rgb(152, 95, 13)" class="btn bg-orange btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 2 + ')">无效</button>');

                                        } else if (row.isEffectiveFlag === 2) {
                                            elements.push('<button style="width: 48px" class="btn btn-success btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 1 + ')">有效</button>');
                                            if (mode === 'edit' && finishStatus != 3 && row.isPrototypeDataFlag != 1) {
                                                elements.push('<button style="width: 48px" class="btn btn-danger btn-xs" onclick="removeMat(' + row.id + ')">删除</button>');
                                            }
                                        }
                                    }
                                }
                                return elements.join('');
                            }
                        }
                    ]
                });
            } else if (costCode.indexOf("-喷涂") > -1) {
                table = js.table.init({
                    id: "bootstrap-table",
                    queryForm: 'queryForm',
                    url: ctx + "estimateManage/workingHoursOrAuxiliaryList",
                    showColumns: true,
                    showExport: true,
                    pagination: true,                                   // 是否显示分页
                    toolbar: '#toolBar',
                    uniqueId: "id",
                    queryParams: function (params) {
                        let curParams = {
                            // 传递参数查询参数
                            pageSize: params.limit,
                            pageNum: params.offset / params.limit + 1,
                            sort: params.sort,
                            order: params.order,
                            dataType: '工时'
                        };
                        return $.extend(curParams, this.queryData, js.formToJSON(this.queryForm));
                    },
                    onLoadSuccess: function (data) {
                    },
                    columns: [
                        {
                            checkbox: true,
                            width: '30px'
                        },
                        {
                            title: '序号', field: 'id', width: '60',
                            formatter: function (value, row, index, field) {
                                var pageSize = table.bootstrapTable('getOptions').pageSize;
                                var pageNumber = table.bootstrapTable('getOptions').pageNumber;
                                return pageSize * (pageNumber - 1) + index + 1;
                            }
                        },
                        {title: '部分', field: 'part', width: '120'},
                        {title: '专业', field: 'major'},
                        {title: '喷涂类别', field: 'sprayType'},
                        {title: '喷涂工时类别', field: 'laborName', width: '200'},
                        {title: '数量', field: 'laborNum'},
                        {title: '单位', field: 'unit', width: '50'},
                        {
                            title: '成本金额',
                            formatter: function (value, row) {
                                return row.laborNum * $("#input_avg_mac").val();
                            }
                        },
                        {title: '备注', field: 'remark'}
                        ,
                        {
                            title: '金额来源', field: 'priceType', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">系统获取</label>';
                                } else if (value === 2) {
                                    return '<label class="badge label-warning">人工编辑</label>';
                                }
                            }
                        },
                        {
                            title: '数据类型', field: 'isPrototypeDataFlag', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">样机数据</label>';
                                } else {
                                    return '<label class="badge label-warning">导入数据</label>';
                                }
                            }
                        },
                        {
                            title: '数据状态', field: 'isEffectiveFlag', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">有效</label>';
                                } else {
                                    return '<label class="badge label-danger">无效</label>';
                                }
                            }
                        },
                        {
                            title: '操作',
                            formatter: function (value, row, index) {
                                let elements = new Array();
                                if (hasP('rou:adjust:edit')) {
                                    let mode = $("#mode").val();
                                    let finishStatus = $("#queryForm [name='finishStatus']").val();
                                    if (mode === 'edit' && finishStatus != 3) {
                                        elements.push('<button style="width: 48px;" class="btn btn-warning btn-xs" onclick="showEditPanel(' + row.id + ')">编辑</button>');
                                        if (row.isEffectiveFlag === 1) {
                                            elements.push('<button style="width: 48px;border-color: #985f0d;border-top-color: rgb(152, 95, 13);border-right-color: rgb(152, 95, 13);border-bottom-color: rgb(152, 95, 13);border-left-color: rgb(152, 95, 13)" class="btn bg-orange btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 2 + ')">无效</button>');

                                        } else if (row.isEffectiveFlag === 2) {
                                            elements.push('<button style="width: 48px" class="btn btn-success btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 1 + ')">有效</button>');
                                            if (mode === 'edit' && finishStatus != 3 && row.isPrototypeDataFlag != 1) {
                                                elements.push('<button style="width: 48px" class="btn btn-danger btn-xs" onclick="removeMat(' + row.id + ')">删除</button>');
                                            }
                                        }
                                    }
                                }
                                return elements.join('');
                            }
                        }
                    ]
                });
                $("#queryForm [name='auxiliaryMaterials']").val(true);
                table1 = js.table.init({
                    id: "bootstrap-table1",
                    queryForm: 'queryForm',
                    url: ctx + "estimateManage/workingHoursOrAuxiliaryList",
                    showColumns: true,
                    showExport: true,
                    pagination: true,                                   // 是否显示分页
                    uniqueId: "id",
                    queryParams: function (params) {
                        let curParams = {
                            // 传递参数查询参数
                            pageSize: params.limit,
                            pageNum: params.offset / params.limit + 1,
                            sort: params.sort,
                            order: params.order,
                            dataType: '辅材'
                        };
                        return $.extend(curParams, this.queryData, js.formToJSON(this.queryForm));
                    },
                    columns: [
                        {
                            checkbox: true,
                            width: '30px'
                        },
                        {
                            title: '序号', field: 'id', width: '60',
                            formatter: function (value, row, index, field) {
                                var pageSize = table1.bootstrapTable('getOptions').pageSize;
                                var pageNumber = table1.bootstrapTable('getOptions').pageNumber;
                                return pageSize * (pageNumber - 1) + index + 1;
                            }
                        },
                        {title: '部分', field: 'part', width: '120'},
                        {title: '专业', field: 'major'},
                        {title: '喷涂类别', field: 'sprayType'},
                        {title: '主要辅材类别', field: 'laborName', width: '200'},
                        {title: '主要辅材用量', field: 'laborNum'},
                        {title: '单位', field: 'unit', width: '50'},
                        {title: '单价', field: 'price'},
                        {
                            title: '成本金额',
                            formatter: function (value, row, index) {
                                return row.laborNum * row.price;
                            }
                        },
                        {title: '备注', field: 'remark'}
                        ,
                        {
                            title: '金额来源', field: 'priceType', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">系统获取</label>';
                                } else if (value === 2) {
                                    return '<label class="badge label-warning">人工编辑</label>';
                                }
                            }
                        },
                        {
                            title: '数据类型', field: 'isPrototypeDataFlag', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">样机数据</label>';
                                } else {
                                    return '<label class="badge label-warning">导入数据</label>';
                                }
                            }
                        },
                        {
                            title: '数据状态', field: 'isEffectiveFlag', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">有效</label>';
                                } else {
                                    return '<label class="badge label-danger">无效</label>';
                                }
                            }
                        },
                        {
                            title: '操作',
                            formatter: function (value, row, index) {
                                let elements = new Array();
                                if (hasP('rou:adjust:edit')) {
                                    let mode = $("#mode").val();
                                    let finishStatus = $("#queryForm [name='finishStatus']").val();

                                    if (mode === 'edit' && finishStatus != 3) {
                                        elements.push('<button style="width: 48px;" class="btn btn-warning btn-xs" onclick="showEditPanel(' + row.id + ')">编辑</button>');
                                        if (row.isEffectiveFlag === 1) {
                                            elements.push('<button style="width: 48px;border-color: #985f0d;border-top-color: rgb(152, 95, 13);border-right-color: rgb(152, 95, 13);border-bottom-color: rgb(152, 95, 13);border-left-color: rgb(152, 95, 13)" class="btn bg-orange btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 2 + ')">无效</button>');

                                        } else if (row.isEffectiveFlag === 2) {
                                            elements.push('<button style="width: 48px" class="btn btn-success btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 1 + ')">有效</button>');
                                            if (mode === 'edit' && finishStatus != 3 && row.isPrototypeDataFlag != 1) {
                                                elements.push('<button style="width: 48px" class="btn btn-danger btn-xs" onclick="removeMat(' + row.id + ')">删除</button>');
                                            }
                                        }
                                    }
                                }
                                return elements.join('');
                            }
                        }
                    ]
                });
            } else if (costCode.indexOf("-装配") > -1) {
                table = js.table.init({
                    id: "bootstrap-table",
                    queryForm: 'queryForm',
                    url: ctx + "estimateManage/workingHoursOrAuxiliaryList",
                    showColumns: true,
                    showExport: true,
                    pagination: true,                                   // 是否显示分页
                    toolbar: '#toolBar',
                    uniqueId: "id",
                    queryParams: function (params) {
                        let curParams = {
                            // 传递参数查询参数
                            pageSize: params.limit,
                            pageNum: params.offset / params.limit + 1,
                            sort: params.sort,
                            order: params.order,
                            dataType: '工时'
                        };
                        return $.extend(curParams, this.queryData, js.formToJSON(this.queryForm));
                    },
                    onLoadSuccess: function (data) {
                    },
                    columns: [
                        {
                            checkbox: true,
                            width: '30px'
                        },
                        {
                            title: '序号', field: 'id', width: '60',
                            formatter: function (value, row, index, field) {
                                var pageSize = table.bootstrapTable('getOptions').pageSize;
                                var pageNumber = table.bootstrapTable('getOptions').pageNumber;
                                return pageSize * (pageNumber - 1) + index + 1;
                            }
                        },
                        {title: '部分', field: 'part', width: '120'},
                        {title: '专业', field: 'major'},
                        {title: '装配工时类别', field: 'laborName', width: '200'},
                        {title: '数量', field: 'laborNum'},
                        {title: '单位', field: 'unit', width: '50'},
                        {
                            title: '成本金额',
                            formatter: function (value, row) {
                                return row.laborNum * $("#input_avg_mac").val();
                            }
                        },
                        {title: '备注', field: 'remark'}
                        ,
                        {
                            title: '金额来源', field: 'priceType', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">系统获取</label>';
                                } else if (value === 2) {
                                    return '<label class="badge label-warning">人工编辑</label>';
                                }
                            }
                        },
                        {
                            title: '数据类型', field: 'isPrototypeDataFlag', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">样机数据</label>';
                                } else {
                                    return '<label class="badge label-warning">导入数据</label>';
                                }
                            }
                        },
                        {
                            title: '数据状态', field: 'isEffectiveFlag', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">有效</label>';
                                } else {
                                    return '<label class="badge label-danger">无效</label>';
                                }
                            }
                        },
                        {
                            title: '操作',
                            formatter: function (value, row, index) {
                                let elements = new Array();
                                if (hasP('rou:adjust:edit')) {
                                    let mode = $("#mode").val();
                                    let finishStatus = $("#queryForm [name='finishStatus']").val();
                                    if (mode === 'edit' && finishStatus != 3) {
                                        elements.push('<button style="width: 48px;" class="btn btn-warning btn-xs" onclick="showEditPanel(' + row.id + ')">编辑</button>');
                                        if (row.isEffectiveFlag === 1) {
                                            elements.push('<button style="width: 48px;border-color: #985f0d;border-top-color: rgb(152, 95, 13);border-right-color: rgb(152, 95, 13);border-bottom-color: rgb(152, 95, 13);border-left-color: rgb(152, 95, 13)" class="btn bg-orange btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 2 + ')">无效</button>');

                                        } else if (row.isEffectiveFlag === 2) {
                                            elements.push('<button style="width: 48px" class="btn btn-success btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 1 + ')">有效</button>');
                                            if (mode === 'edit' && finishStatus != 3 && row.isPrototypeDataFlag != 1) {
                                                elements.push('<button style="width: 48px" class="btn btn-danger btn-xs" onclick="removeMat(' + row.id + ')">删除</button>');
                                            }
                                        }
                                    }
                                }
                                return elements.join('');
                            }
                        }
                    ]
                });
                $("#queryForm [name='auxiliaryMaterials']").val(true);
                table1 = js.table.init({
                    id: "bootstrap-table1",
                    queryForm: 'queryForm',
                    url: ctx + "estimateManage/workingHoursOrAuxiliaryList",
                    showColumns: true,
                    showExport: true,
                    pagination: true,                                   // 是否显示分页
                    uniqueId: "id",
                    queryParams: function (params) {
                        let curParams = {
                            // 传递参数查询参数
                            pageSize: params.limit,
                            pageNum: params.offset / params.limit + 1,
                            sort: params.sort,
                            order: params.order,
                            dataType: '辅材'
                        };
                        return $.extend(curParams, this.queryData, js.formToJSON(this.queryForm));
                    },
                    columns: [
                        {
                            checkbox: true,
                            width: '30px'
                        },
                        {
                            title: '序号', field: 'id', width: '60',
                            formatter: function (value, row, index, field) {
                                var pageSize = table1.bootstrapTable('getOptions').pageSize;
                                var pageNumber = table1.bootstrapTable('getOptions').pageNumber;
                                return pageSize * (pageNumber - 1) + index + 1;
                            }
                        },
                        {title: '部分', field: 'part', width: '120'},
                        {title: '专业', field: 'major'},
                        {title: '主要辅材类别', field: 'laborName', width: '200'},
                        {title: '主要辅材用量', field: 'laborNum'},
                        {title: '单位', field: 'unit', width: '50'},
                        {title: '单价', field: 'price'},
                        {
                            title: '成本金额',
                            formatter: function (value, row, index) {
                                return row.laborNum * row.price;
                            }
                        },
                        {title: '备注', field: 'remark'}
                        ,
                        {
                            title: '金额来源', field: 'priceType', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">系统获取</label>';
                                } else if (value === 2) {
                                    return '<label class="badge label-warning">人工编辑</label>';
                                }
                            }
                        },
                        {
                            title: '数据类型', field: 'isPrototypeDataFlag', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">样机数据</label>';
                                } else {
                                    return '<label class="badge label-warning">导入数据</label>';
                                }
                            }
                        },
                        {
                            title: '数据状态', field: 'isEffectiveFlag', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">有效</label>';
                                } else {
                                    return '<label class="badge label-danger">无效</label>';
                                }
                            }
                        },
                        {
                            title: '操作',
                            formatter: function (value, row, index) {
                                let elements = new Array();
                                if (hasP('rou:adjust:edit')) {
                                    let mode = $("#mode").val();
                                    let finishStatus = $("#queryForm [name='finishStatus']").val();

                                    if (mode === 'edit' && finishStatus != 3) {
                                        elements.push('<button style="width: 48px;" class="btn btn-warning btn-xs" onclick="showEditPanel(' + row.id + ')">编辑</button>');
                                        if (row.isEffectiveFlag === 1) {
                                            elements.push('<button style="width: 48px;border-color: #985f0d;border-top-color: rgb(152, 95, 13);border-right-color: rgb(152, 95, 13);border-bottom-color: rgb(152, 95, 13);border-left-color: rgb(152, 95, 13)" class="btn bg-orange btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 2 + ')">无效</button>');

                                        } else if (row.isEffectiveFlag === 2) {
                                            elements.push('<button style="width: 48px" class="btn btn-success btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 1 + ')">有效</button>');
                                            if (mode === 'edit' && finishStatus != 3 && row.isPrototypeDataFlag != 1) {
                                                elements.push('<button style="width: 48px" class="btn btn-danger btn-xs" onclick="removeMat(' + row.id + ')">删除</button>');
                                            }
                                        }
                                    }
                                }
                                return elements.join('');
                            }
                        }
                    ]
                });
            } else if (costCode.indexOf("-热处理") > -1) {
                table = js.table.init({
                    id: "bootstrap-table",
                    queryForm: 'queryForm',
                    url: ctx + "estimateManage/workingHoursOrAuxiliaryList",
                    showColumns: true,
                    showExport: true,
                    pagination: true,                                   // 是否显示分页
                    toolbar: '#toolBar',
                    uniqueId: "id",
                    queryParams: function (params) {
                        let curParams = {
                            // 传递参数查询参数
                            pageSize: params.limit,
                            pageNum: params.offset / params.limit + 1,
                            sort: params.sort,
                            order: params.order,
                            dataType: '重量'
                        };
                        return $.extend(curParams, this.queryData, js.formToJSON(this.queryForm));
                    },
                    onLoadSuccess: function (data) {
                    },
                    columns: [
                        {
                            checkbox: true,
                            width: '30px'
                        },
                        {
                            title: '序号', field: 'id', width: '60',
                            formatter: function (value, row, index, field) {
                                var pageSize = table.bootstrapTable('getOptions').pageSize;
                                var pageNumber = table.bootstrapTable('getOptions').pageNumber;
                                return pageSize * (pageNumber - 1) + index + 1;
                            }
                        },
                        {title: '部分', field: 'part', width: '120'},
                        {title: '专业', field: 'major'},
                        {title: '热处理形式', field: 'laborName', width: '200'},
                        {title: '数量', field: 'laborNum'},
                        {title: '单位', field: 'unit', width: '50'},
                        {title: '单价', field: 'price', width: '50'},
                        {
                            title: '成本金额', width: '50',
                            formatter: function (value, row) {
                                return row.laborNum * row.price;
                            }
                        },

                        {title: '备注', field: 'remark'}
                        ,
                        {
                            title: '金额来源', field: 'priceType', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">系统获取</label>';
                                } else if (value === 2) {
                                    return '<label class="badge label-warning">人工编辑</label>';
                                }
                            }
                        },
                        {
                            title: '数据类型', field: 'isPrototypeDataFlag', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">样机数据</label>';
                                } else {
                                    return '<label class="badge label-warning">导入数据</label>';
                                }
                            }
                        },
                        {
                            title: '数据状态', field: 'isEffectiveFlag', width: '65',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '<label class="badge label-success">有效</label>';
                                } else {
                                    return '<label class="badge label-danger">无效</label>';
                                }
                            }
                        },
                        {
                            title: '操作',
                            formatter: function (value, row, index) {
                                let elements = new Array();
                                if (hasP('rou:adjust:edit')) {
                                    let mode = $("#mode").val();
                                    let finishStatus = $("#queryForm [name='finishStatus']").val();
                                    if (mode === 'edit' && finishStatus != 3) {
                                        elements.push('<button style="width: 48px;" class="btn btn-warning btn-xs" onclick="showEditPanel(' + row.id + ')">编辑</button>');
                                        if (row.isEffectiveFlag === 1) {
                                            elements.push('<button style="width: 48px;border-color: #985f0d;border-top-color: rgb(152, 95, 13);border-right-color: rgb(152, 95, 13);border-bottom-color: rgb(152, 95, 13);border-left-color: rgb(152, 95, 13)" class="btn bg-orange btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 2 + ')">无效</button>');

                                        } else if (row.isEffectiveFlag === 2) {
                                            elements.push('<button style="width: 48px" class="btn btn-success btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 1 + ')">有效</button>');
                                            if (mode === 'edit' && finishStatus != 3 && row.isPrototypeDataFlag != 1) {
                                                elements.push('<button style="width: 48px" class="btn btn-danger btn-xs" onclick="removeMat(' + row.id + ')">删除</button>');
                                            }
                                        }
                                    }
                                }
                                return elements.join('');
                            }
                        }
                    ]
                });
            }
        } else if (costCode.indexOf("-外购费") > -1) {
            table = js.table.init({
                id: "bootstrap-table",
                queryForm: 'queryForm',
                url: ctx + "estimateManage/purList",
                showColumns: true,
                showExport: true,
                pagination: true,                                   // 是否显示分页
                toolbar: '#toolBar',
                uniqueId: "id",
                queryParams: function (params) {
                    let curParams = {
                        // 传递参数查询参数
                        pageSize: params.limit,
                        pageNum: params.offset / params.limit + 1,
                        sort: params.sort,
                        order: params.order
                    };
                    return $.extend(curParams, this.queryData, js.formToJSON(this.queryForm));
                },
                onLoadSuccess: function (data) {
                },
                columns: [
                    {
                        checkbox: true,
                        width: '30px'
                    },
                    {
                        title: '序号', field: 'id', width: '60',
                        formatter: function (value, row, index, field) {
                            var pageSize = table.bootstrapTable('getOptions').pageSize;
                            var pageNumber = table.bootstrapTable('getOptions').pageNumber;
                            return pageSize * (pageNumber - 1) + index + 1;
                        }
                    },
                    {title: '部分', field: 'part', width: '120'},
                    {title: '专业', field: 'major'},
                    {title: '提报计划物料描述', field: 'matDesc', width: '200'},
                    {title: '实用数量', field: 'num'},
                    {title: '单位', field: 'unit', width: '50'},
                    {title: '型号/标准号', field: 'standardNo'},
                    {title: '品牌', field: 'brand'},
                    {title: '备注', field: 'remark'},
                    {title: 'SAP物料编码', field: 'sapCode'},
                    {title: '采购物料描述', field: 'buyMatDesc'},
                    {title: '单价', field: 'price', width: '50'},
                    {
                        title: '总价', width: '50',
                        formatter: function (value, row) {
                            return row.num * row.price;
                        }
                    },
                    {
                        title: '金额来源', field: 'priceType', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">系统获取</label>';
                            } else if (value === 2) {
                                return '<label class="badge label-warning">人工编辑</label>';
                            }
                        }
                    },
                    {
                        title: '数据类型', field: 'isPrototypeDataFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">样机数据</label>';
                            } else {
                                return '<label class="badge label-warning">导入数据</label>';
                            }
                        }
                    },
                    {
                        title: '数据状态', field: 'isEffectiveFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">有效</label>';
                            } else {
                                return '<label class="badge label-danger">无效</label>';
                            }
                        }
                    },
                    {
                        title: '操作',
                        formatter: function (value, row, index) {
                            let elements = new Array();
                            if (hasP('rou:adjust:edit')) {
                                let mode = $("#mode").val();
                                let finishStatus = $("#queryForm [name='finishStatus']").val();
                                if (mode === 'edit' && finishStatus != 3) {
                                    elements.push('<button style="width: 48px;" class="btn btn-warning btn-xs" onclick="showEditPanel(' + row.id + ')">编辑</button>');
                                    if (row.isEffectiveFlag === 1) {
                                        elements.push('<button style="width: 48px;border-color: #985f0d;border-top-color: rgb(152, 95, 13);border-right-color: rgb(152, 95, 13);border-bottom-color: rgb(152, 95, 13);border-left-color: rgb(152, 95, 13)" class="btn bg-orange btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 2 + ')">无效</button>');

                                    } else if (row.isEffectiveFlag === 2) {
                                        elements.push('<button style="width: 48px" class="btn btn-success btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 1 + ')">有效</button>');
                                        if (mode === 'edit' && finishStatus != 3 && row.isPrototypeDataFlag != 1) {
                                            elements.push('<button style="width: 48px" class="btn btn-danger btn-xs" onclick="removeMat(' + row.id + ')">删除</button>');
                                        }
                                    }
                                }
                            }
                            return elements.join('');
                        }
                    }
                ]
            });
        } else if (costCode.indexOf("-外协费-整体外协") > -1) {
            table = js.table.init({
                id: "bootstrap-table",
                queryForm: 'queryForm',
                url: ctx + "estimateManage/wholeList",
                showColumns: true,
                showExport: true,
                pagination: true,                                   // 是否显示分页
                toolbar: '#toolBar',
                uniqueId: "id",
                queryParams: function (params) {
                    let curParams = {
                        // 传递参数查询参数
                        pageSize: params.limit,
                        pageNum: params.offset / params.limit + 1,
                        sort: params.sort,
                        order: params.order
                    };
                    return $.extend(curParams, this.queryData, js.formToJSON(this.queryForm));
                },
                onLoadSuccess: function (data) {
                },
                columns: [
                    {
                        checkbox: true,
                        width: '30px'
                    },
                    {
                        title: '序号', field: 'id', width: '60',
                        formatter: function (value, row, index, field) {
                            var pageSize = table.bootstrapTable('getOptions').pageSize;
                            var pageNumber = table.bootstrapTable('getOptions').pageNumber;
                            return pageSize * (pageNumber - 1) + index + 1;
                        }
                    },
                    {title: '部分', field: 'part', width: '120'},
                    {title: '专业', field: 'major'},
                    {title: '提报计划物料描述', field: 'matDesc', width: '200'},
                    {title: '图号', field: 'diagram', width: '200'},
                    {title: '实用数量', field: 'num'},
                    {title: '单位', field: 'unit', width: '50'},
                    {title: '外协类型', field: 'assistType'},
                    {title: '备注', field: 'remark'},
                    {title: 'SAP物料编码', field: 'sapCode'},
                    {title: '采购物料描述', field: 'buyMatDesc'},
                    {title: '单价', field: 'price', width: '50'},
                    {
                        title: '总价', width: '50',
                        formatter: function (value, row) {
                            return row.num * row.price;
                        }
                    },
                    {
                        title: '金额来源', field: 'priceType', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">系统获取</label>';
                            } else if (value === 2) {
                                return '<label class="badge label-warning">人工编辑</label>';
                            }
                        }
                    },
                    {
                        title: '数据类型', field: 'isPrototypeDataFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">样机数据</label>';
                            } else {
                                return '<label class="badge label-warning">导入数据</label>';
                            }
                        }
                    },
                    {
                        title: '数据状态', field: 'isEffectiveFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">有效</label>';
                            } else {
                                return '<label class="badge label-danger">无效</label>';
                            }
                        }
                    },
                    {
                        title: '操作',
                        formatter: function (value, row, index) {
                            let elements = new Array();
                            if (hasP('rou:adjust:edit')) {
                                let mode = $("#mode").val();
                                let finishStatus = $("#queryForm [name='finishStatus']").val();
                                if (mode === 'edit' && finishStatus != 3) {
                                    elements.push('<button style="width: 48px;" class="btn btn-warning btn-xs" onclick="showEditPanel(' + row.id + ')">编辑</button>');
                                    if (row.isEffectiveFlag === 1) {
                                        elements.push('<button style="width: 48px;border-color: #985f0d;border-top-color: rgb(152, 95, 13);border-right-color: rgb(152, 95, 13);border-bottom-color: rgb(152, 95, 13);border-left-color: rgb(152, 95, 13)" class="btn bg-orange btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 2 + ')">无效</button>');

                                    } else if (row.isEffectiveFlag === 2) {
                                        elements.push('<button style="width: 48px" class="btn btn-success btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 1 + ')">有效</button>');
                                        if (mode === 'edit' && finishStatus != 3 && row.isPrototypeDataFlag != 1) {
                                            elements.push('<button style="width: 48px" class="btn btn-danger btn-xs" onclick="removeMat(' + row.id + ')">删除</button>');
                                        }
                                    }
                                }
                            }
                            return elements.join('');
                        }
                    }
                ]
            });
        } else if (costCode.indexOf("-外协费-带料外协") > -1) {
            table = js.table.init({
                id: "bootstrap-table",
                queryForm: 'queryForm',
                url: ctx + "estimateManage/whishMatList",
                showColumns: true,
                showExport: true,
                pagination: true,                                   // 是否显示分页
                toolbar: '#toolBar',
                uniqueId: "id",
                queryParams: function (params) {
                    let curParams = {
                        // 传递参数查询参数
                        pageSize: params.limit,
                        pageNum: params.offset / params.limit + 1,
                        sort: params.sort,
                        order: params.order
                    };
                    return $.extend(curParams, this.queryData, js.formToJSON(this.queryForm));
                },
                onLoadSuccess: function (data) {
                },
                columns: [
                    {
                        checkbox: true,
                        width: '30px'
                    },
                    {
                        title: '序号', field: 'id', width: '60',
                        formatter: function (value, row, index, field) {
                            var pageSize = table.bootstrapTable('getOptions').pageSize;
                            var pageNumber = table.bootstrapTable('getOptions').pageNumber;
                            return pageSize * (pageNumber - 1) + index + 1;
                        }
                    },
                    {title: '部分', field: 'part', width: '120'},
                    {title: '专业', field: 'major'},
                    {title: '提报计划物料描述', field: 'matDesc', width: '200'},
                    {title: '图号', field: 'diagram', width: '200'},
                    {title: '实用数量', field: 'num'},
                    {title: '单位', field: 'unit', width: '50'},
                    {title: '外协类型', field: 'assistType'},
                    {title: '备注', field: 'remark'},
                    {title: 'SAP物料编码', field: 'sapCode'},
                    {title: '采购物料描述', field: 'buyMatDesc'},
                    {title: '单价', field: 'price', width: '50'},
                    {
                        title: '总价', width: '50',
                        formatter: function (value, row) {
                            return row.num * row.price;
                        }
                    },
                    {
                        title: '金额来源', field: 'priceType', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">系统获取</label>';
                            } else if (value === 2) {
                                return '<label class="badge label-warning">人工编辑</label>';
                            }
                        }
                    },
                    {
                        title: '数据类型', field: 'isPrototypeDataFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">样机数据</label>';
                            } else {
                                return '<label class="badge label-warning">导入数据</label>';
                            }
                        }
                    },
                    {
                        title: '数据状态', field: 'isEffectiveFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">有效</label>';
                            } else {
                                return '<label class="badge label-danger">无效</label>';
                            }
                        }
                    },
                    {
                        title: '操作',
                        formatter: function (value, row, index) {
                            let elements = new Array();
                            if (hasP('rou:adjust:edit')) {
                                let mode = $("#mode").val();
                                let finishStatus = $("#queryForm [name='finishStatus']").val();
                                if (mode === 'edit' && finishStatus != 3) {
                                    elements.push('<button style="width: 48px;" class="btn btn-warning btn-xs" onclick="showEditPanel(' + row.id + ')">编辑</button>');
                                    if (row.isEffectiveFlag === 1) {
                                        elements.push('<button style="width: 48px;border-color: #985f0d;border-top-color: rgb(152, 95, 13);border-right-color: rgb(152, 95, 13);border-bottom-color: rgb(152, 95, 13);border-left-color: rgb(152, 95, 13)" class="btn bg-orange btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 2 + ')">无效</button>');

                                    } else if (row.isEffectiveFlag === 2) {
                                        elements.push('<button style="width: 48px" class="btn btn-success btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 1 + ')">有效</button>');
                                        if (mode === 'edit' && finishStatus != 3 && row.isPrototypeDataFlag != 1) {
                                            elements.push('<button style="width: 48px" class="btn btn-danger btn-xs" onclick="removeMat(' + row.id + ')">删除</button>');
                                        }
                                    }
                                }
                            }
                            return elements.join('');
                        }
                    }
                ]
            });
        } else if (costCode.indexOf("-现场安装费-人工-安装人工") > -1) {
            table = js.table.init({
                id: "bootstrap-table",
                queryForm: 'queryForm',
                url: ctx + "estimateManage/workingHoursOrAuxiliaryList",
                showColumns: true,
                showExport: true,
                pagination: true,                                   // 是否显示分页
                toolbar: '#toolBar',
                uniqueId: "id",
                queryParams: function (params) {
                    let curParams = {
                        // 传递参数查询参数
                        pageSize: params.limit,
                        pageNum: params.offset / params.limit + 1,
                        sort: params.sort,
                        order: params.order,
                        dataType: '工时'
                    };
                    return $.extend(curParams, this.queryData, js.formToJSON(this.queryForm));
                },
                onLoadSuccess: function (data) {
                },
                columns: [
                    {
                        checkbox: true,
                        width: '30px'
                    },
                    {
                        title: '序号', field: 'id', width: '60',
                        formatter: function (value, row, index, field) {
                            var pageSize = table.bootstrapTable('getOptions').pageSize;
                            var pageNumber = table.bootstrapTable('getOptions').pageNumber;
                            return pageSize * (pageNumber - 1) + index + 1;
                        }
                    },
                    {title: '部分', field: 'part', width: '120'},
                    {title: '专业', field: 'major'},
                    {title: '安装工时类别', field: 'laborName', width: '200'},
                    {title: '数量', field: 'laborNum'},
                    {title: '单位', field: 'unit', width: '50'},
                    {
                        title: '成本金额',
                        formatter: function (value, row) {
                            return row.laborNum * $("#input_install_debug").val();
                        }
                    },
                    {title: '备注', field: 'remark'}
                    ,
                    {
                        title: '金额来源', field: 'priceType', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">系统获取</label>';
                            } else if (value === 2) {
                                return '<label class="badge label-warning">人工编辑</label>';
                            }
                        }
                    },
                    {
                        title: '数据类型', field: 'isPrototypeDataFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">样机数据</label>';
                            } else {
                                return '<label class="badge label-warning">导入数据</label>';
                            }
                        }
                    },
                    {
                        title: '数据状态', field: 'isEffectiveFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">有效</label>';
                            } else {
                                return '<label class="badge label-danger">无效</label>';
                            }
                        }
                    },
                    {
                        title: '操作',
                        formatter: function (value, row, index) {
                            let elements = new Array();
                            if (hasP('rou:adjust:edit')) {
                                let mode = $("#mode").val();
                                let finishStatus = $("#queryForm [name='finishStatus']").val();
                                if (mode === 'edit' && finishStatus != 3) {
                                    elements.push('<button style="width: 48px;" class="btn btn-warning btn-xs" onclick="showEditPanel(' + row.id + ')">编辑</button>');
                                    if (row.isEffectiveFlag === 1) {
                                        elements.push('<button style="width: 48px;border-color: #985f0d;border-top-color: rgb(152, 95, 13);border-right-color: rgb(152, 95, 13);border-bottom-color: rgb(152, 95, 13);border-left-color: rgb(152, 95, 13)" class="btn bg-orange btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 2 + ')">无效</button>');

                                    } else if (row.isEffectiveFlag === 2) {
                                        elements.push('<button style="width: 48px" class="btn btn-success btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 1 + ')">有效</button>');
                                        if (mode === 'edit' && finishStatus != 3 && row.isPrototypeDataFlag != 1) {
                                            elements.push('<button style="width: 48px" class="btn btn-danger btn-xs" onclick="removeMat(' + row.id + ')">删除</button>');
                                        }
                                    }
                                }
                            }
                            return elements.join('');
                        }
                    }
                ]
            });
        } else if (costCode.indexOf("-现场安装费-人工-调试人工") > -1) {
            table = js.table.init({
                id: "bootstrap-table",
                queryForm: 'queryForm',
                url: ctx + "estimateManage/workingHoursOrAuxiliaryList",
                showColumns: true,
                showExport: true,
                pagination: true,                                   // 是否显示分页
                toolbar: '#toolBar',
                uniqueId: "id",
                queryParams: function (params) {
                    let curParams = {
                        // 传递参数查询参数
                        pageSize: params.limit,
                        pageNum: params.offset / params.limit + 1,
                        sort: params.sort,
                        order: params.order,
                        dataType: '工时'
                    };
                    return $.extend(curParams, this.queryData, js.formToJSON(this.queryForm));
                },
                onLoadSuccess: function (data) {
                },
                columns: [
                    {
                        checkbox: true,
                        width: '30px'
                    },
                    {
                        title: '序号', field: 'id', width: '60',
                        formatter: function (value, row, index, field) {
                            var pageSize = table.bootstrapTable('getOptions').pageSize;
                            var pageNumber = table.bootstrapTable('getOptions').pageNumber;
                            return pageSize * (pageNumber - 1) + index + 1;
                        }
                    },
                    {title: '部分', field: 'part', width: '120'},
                    {title: '专业', field: 'major'},
                    {title: '安装工时类别', field: 'laborName', width: '200'},
                    {title: '数量', field: 'laborNum'},
                    {title: '单位', field: 'unit', width: '50'},
                    {
                        title: '成本金额',
                        formatter: function (value, row) {
                            return row.laborNum * $("#input_install_debug").val();
                        }
                    },
                    {title: '备注', field: 'remark'}
                    ,
                    {
                        title: '金额来源', field: 'priceType', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">系统获取</label>';
                            } else if (value === 2) {
                                return '<label class="badge label-warning">人工编辑</label>';
                            }
                        }
                    },
                    {
                        title: '数据类型', field: 'isPrototypeDataFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">样机数据</label>';
                            } else {
                                return '<label class="badge label-warning">导入数据</label>';
                            }
                        }
                    },
                    {
                        title: '数据状态', field: 'isEffectiveFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">有效</label>';
                            } else {
                                return '<label class="badge label-danger">无效</label>';
                            }
                        }
                    },
                    {
                        title: '操作',
                        formatter: function (value, row, index) {
                            let elements = new Array();
                            if (hasP('rou:adjust:edit')) {
                                let mode = $("#mode").val();
                                let finishStatus = $("#queryForm [name='finishStatus']").val();
                                if (mode === 'edit' && finishStatus != 3) {
                                    elements.push('<button style="width: 48px;" class="btn btn-warning btn-xs" onclick="showEditPanel(' + row.id + ')">编辑</button>');
                                    if (row.isEffectiveFlag === 1) {
                                        elements.push('<button style="width: 48px;border-color: #985f0d;border-top-color: rgb(152, 95, 13);border-right-color: rgb(152, 95, 13);border-bottom-color: rgb(152, 95, 13);border-left-color: rgb(152, 95, 13)" class="btn bg-orange btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 2 + ')">无效</button>');

                                    } else if (row.isEffectiveFlag === 2) {
                                        elements.push('<button style="width: 48px" class="btn btn-success btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 1 + ')">有效</button>');
                                        if (mode === 'edit' && finishStatus != 3 && row.isPrototypeDataFlag != 1) {
                                            elements.push('<button style="width: 48px" class="btn btn-danger btn-xs" onclick="removeMat(' + row.id + ')">删除</button>');
                                        }
                                    }
                                }
                            }
                            return elements.join('');
                        }
                    }
                ]
            });
        } else if (costCode.indexOf("-现场安装费-辅材") > -1) {
            table = js.table.init({
                id: "bootstrap-table",
                queryForm: 'queryForm',
                url: ctx + "estimateManage/workingHoursOrAuxiliaryList",
                showColumns: true,
                showExport: true,
                pagination: true,                                   // 是否显示分页
                toolbar: '#toolBar',
                uniqueId: "id",
                queryParams: function (params) {
                    let curParams = {
                        // 传递参数查询参数
                        pageSize: params.limit,
                        pageNum: params.offset / params.limit + 1,
                        sort: params.sort,
                        order: params.order,
                        dataType: '辅材'
                    };
                    return $.extend(curParams, this.queryData, js.formToJSON(this.queryForm));
                },
                columns: [
                    {
                        checkbox: true,
                        width: '30px'
                    },
                    {
                        title: '序号', field: 'id', width: '60',
                        formatter: function (value, row, index, field) {
                            var pageSize = table.bootstrapTable('getOptions').pageSize;
                            var pageNumber = table.bootstrapTable('getOptions').pageNumber;
                            return pageSize * (pageNumber - 1) + index + 1;
                        }
                    },
                    {title: '部分', field: 'part', width: '120'},
                    {title: '专业', field: 'major'},
                    {title: '主要辅材类别', field: 'laborName', width: '200'},
                    {title: '主要辅材用量', field: 'laborNum'},
                    {title: '单位', field: 'unit', width: '50'},
                    {title: '单价', field: 'price'},
                    {
                        title: '成本金额',
                        formatter: function (value, row, index) {
                            return row.laborNum * row.price;
                        }
                    },
                    {title: '备注', field: 'remark'}
                    ,
                    {
                        title: '金额来源', field: 'priceType', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">系统获取</label>';
                            } else if (value === 2) {
                                return '<label class="badge label-warning">人工编辑</label>';
                            }
                        }
                    },
                    {
                        title: '数据类型', field: 'isPrototypeDataFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">样机数据</label>';
                            } else {
                                return '<label class="badge label-warning">导入数据</label>';
                            }
                        }
                    },
                    {
                        title: '数据状态', field: 'isEffectiveFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">有效</label>';
                            } else {
                                return '<label class="badge label-danger">无效</label>';
                            }
                        }
                    },
                    {
                        title: '操作',
                        formatter: function (value, row, index) {
                            let elements = new Array();
                            if (hasP('rou:adjust:edit')) {
                                let mode = $("#mode").val();
                                let finishStatus = $("#queryForm [name='finishStatus']").val();

                                if (mode === 'edit' && finishStatus != 3) {
                                    elements.push('<button style="width: 48px;" class="btn btn-warning btn-xs" onclick="showEditPanel(' + row.id + ')">编辑</button>');
                                    if (row.isEffectiveFlag === 1) {
                                        elements.push('<button style="width: 48px;border-color: #985f0d;border-top-color: rgb(152, 95, 13);border-right-color: rgb(152, 95, 13);border-bottom-color: rgb(152, 95, 13);border-left-color: rgb(152, 95, 13)" class="btn bg-orange btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 2 + ')">无效</button>');

                                    } else if (row.isEffectiveFlag === 2) {
                                        elements.push('<button style="width: 48px" class="btn btn-success btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 1 + ')">有效</button>');
                                        if (mode === 'edit' && finishStatus != 3 && row.isPrototypeDataFlag != 1) {
                                            elements.push('<button style="width: 48px" class="btn btn-danger btn-xs" onclick="removeMat(' + row.id + ')">删除</button>');
                                        }
                                    }
                                }
                            }
                            return elements.join('');
                        }
                    }
                ]
            });
        } else if (costCode.indexOf("-设计费") > -1) {
            table = js.table.init({
                id: "bootstrap-table",
                queryForm: 'queryForm',
                url: ctx + "estimateManage/workingHoursOrAuxiliaryList",
                showColumns: true,
                showExport: true,
                pagination: true,                                   // 是否显示分页
                toolbar: '#toolBar',
                uniqueId: "id",
                queryParams: function (params) {
                    let curParams = {
                        // 传递参数查询参数
                        pageSize: params.limit,
                        pageNum: params.offset / params.limit + 1,
                        sort: params.sort,
                        order: params.order,
                        dataType: '工时'
                    };
                    return $.extend(curParams, this.queryData, js.formToJSON(this.queryForm));
                },
                onLoadSuccess: function (data) {
                },
                columns: [
                    {
                        checkbox: true,
                        width: '30px'
                    },
                    {
                        title: '序号', field: 'id', width: '60',
                        formatter: function (value, row, index, field) {
                            var pageSize = table.bootstrapTable('getOptions').pageSize;
                            var pageNumber = table.bootstrapTable('getOptions').pageNumber;
                            return pageSize * (pageNumber - 1) + index + 1;
                        }
                    },
                    {title: '部分', field: 'part', width: '120'},
                    {title: '专业', field: 'major'},
                    {title: '设计工时类别', field: 'laborName', width: '200'},
                    {title: '数量', field: 'laborNum'},
                    {title: '单位', field: 'unit', width: '50'},
                    {
                        title: '成本金额',
                        formatter: function (value, row) {
                            return row.laborNum * $("#input_avg_dsn").val();
                        }
                    },
                    {title: '备注', field: 'remark'}
                    ,
                    {
                        title: '金额来源', field: 'priceType', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">系统获取</label>';
                            } else if (value === 2) {
                                return '<label class="badge label-warning">人工编辑</label>';
                            }
                        }
                    },
                    {
                        title: '数据类型', field: 'isPrototypeDataFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">样机数据</label>';
                            } else {
                                return '<label class="badge label-warning">导入数据</label>';
                            }
                        }
                    },
                    {
                        title: '数据状态', field: 'isEffectiveFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">有效</label>';
                            } else {
                                return '<label class="badge label-danger">无效</label>';
                            }
                        }
                    },
                    {
                        title: '操作',
                        formatter: function (value, row, index) {
                            let elements = new Array();
                            if (hasP('rou:adjust:edit')) {
                                let mode = $("#mode").val();
                                let finishStatus = $("#queryForm [name='finishStatus']").val();
                                if (mode === 'edit' && finishStatus != 3) {
                                    elements.push('<button style="width: 48px;" class="btn btn-warning btn-xs" onclick="showEditPanel(' + row.id + ')">编辑</button>');
                                    if (row.isEffectiveFlag === 1) {
                                        elements.push('<button style="width: 48px;border-color: #985f0d;border-top-color: rgb(152, 95, 13);border-right-color: rgb(152, 95, 13);border-bottom-color: rgb(152, 95, 13);border-left-color: rgb(152, 95, 13)" class="btn bg-orange btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 2 + ')">无效</button>');

                                    } else if (row.isEffectiveFlag === 2) {
                                        elements.push('<button style="width: 48px" class="btn btn-success btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 1 + ')">有效</button>');
                                        if (mode === 'edit' && finishStatus != 3 && row.isPrototypeDataFlag != 1) {
                                            elements.push('<button style="width: 48px" class="btn btn-danger btn-xs" onclick="removeMat(' + row.id + ')">删除</button>');
                                        }
                                    }
                                }
                            }
                            return elements.join('');
                        }
                    }
                ]
            });
            $("#queryForm [name='auxiliaryMaterials']").val(true);
            table1 = js.table.init({
                id: "bootstrap-table1",
                queryForm: 'queryForm',
                url: ctx + "estimateManage/workingHoursOrAuxiliaryList",
                showColumns: true,
                showExport: true,
                toolbar: '#toolBar1',
                pagination: true,                                   // 是否显示分页
                uniqueId: "id",
                queryParams: function (params) {
                    let curParams = {
                        // 传递参数查询参数
                        pageSize: params.limit,
                        pageNum: params.offset / params.limit + 1,
                        sort: params.sort,
                        order: params.order,
                        dataType: '重量'
                    };
                    return $.extend(curParams, this.queryData, js.formToJSON(this.queryForm));
                },
                columns: [
                    {
                        checkbox: true,
                        width: '30px'
                    },
                    {
                        title: '序号', field: 'id', width: '60',
                        formatter: function (value, row, index, field) {
                            var pageSize = table1.bootstrapTable('getOptions').pageSize;
                            var pageNumber = table1.bootstrapTable('getOptions').pageNumber;
                            return pageSize * (pageNumber - 1) + index + 1;
                        }
                    },
                    {title: '部分', field: 'part', width: '120'},
                    {title: '专业', field: 'major'},
                    {title: '设计重量类别', field: 'laborName', width: '200'},
                    {title: '设计重量', field: 'laborNum'},
                    {title: '单位', field: 'unit', width: '50'},
                    {title: '备注', field: 'remark'},
                    {
                        title: '数据类型', field: 'isPrototypeDataFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">样机数据</label>';
                            } else {
                                return '<label class="badge label-warning">导入数据</label>';
                            }
                        }
                    },
                    {
                        title: '数据状态', field: 'isEffectiveFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">有效</label>';
                            } else {
                                return '<label class="badge label-danger">无效</label>';
                            }
                        }
                    },
                    {
                        title: '操作',
                        formatter: function (value, row, index) {
                            let elements = new Array();
                            if (hasP('rou:adjust:edit')) {
                                let mode = $("#mode").val();
                                let finishStatus = $("#queryForm [name='finishStatus']").val();

                                if (mode === 'edit' && finishStatus != 3) {
                                    elements.push('<button style="width: 48px;" class="btn btn-warning btn-xs" onclick="showEditPanel(' + row.id + ')">编辑</button>');
                                    if (row.isEffectiveFlag === 1) {
                                        elements.push('<button style="width: 48px;border-color: #985f0d;border-top-color: rgb(152, 95, 13);border-right-color: rgb(152, 95, 13);border-bottom-color: rgb(152, 95, 13);border-left-color: rgb(152, 95, 13)" class="btn bg-orange btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 2 + ')">无效</button>');

                                    } else if (row.isEffectiveFlag === 2) {
                                        elements.push('<button style="width: 48px" class="btn btn-success btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 1 + ')">有效</button>');
                                        if (mode === 'edit' && finishStatus != 3 && row.isPrototypeDataFlag != 1) {
                                            elements.push('<button style="width: 48px" class="btn btn-danger btn-xs" onclick="removeMat(' + row.id + ')">删除</button>');
                                        }
                                    }
                                }
                            }
                            return elements.join('');
                        }
                    }
                ]
            });
        } else if (costCode.indexOf("包装运输费-包装费") > -1) {
            table = js.table.init({
                id: "bootstrap-table",
                queryForm: 'queryForm',
                url: ctx + "estimateManage/workingHoursOrAuxiliaryList",
                showColumns: true,
                showExport: true,
                pagination: true,                                   // 是否显示分页
                toolbar: '#toolBar',
                uniqueId: "id",
                queryParams: function (params) {
                    let curParams = {
                        // 传递参数查询参数
                        pageSize: params.limit,
                        pageNum: params.offset / params.limit + 1,
                        sort: params.sort,
                        order: params.order,
                        dataType: '工时'
                    };
                    return $.extend(curParams, this.queryData, js.formToJSON(this.queryForm));
                },
                onLoadSuccess: function (data) {
                },
                columns: [
                    {
                        checkbox: true,
                        width: '30px'
                    },
                    {
                        title: '序号', field: 'id', width: '60',
                        formatter: function (value, row, index, field) {
                            var pageSize = table.bootstrapTable('getOptions').pageSize;
                            var pageNumber = table.bootstrapTable('getOptions').pageNumber;
                            return pageSize * (pageNumber - 1) + index + 1;
                        }
                    },
                    {title: '包装工时类别', field: 'laborName', width: '200'},
                    {title: '数量', field: 'laborNum'},
                    {title: '单位', field: 'unit', width: '50'},
                    {
                        title: '成本金额',
                        formatter: function (value, row) {
                            return row.laborNum * $("#input_avg_mac").val();
                        }
                    },
                    {title: '备注', field: 'remark'}
                    ,
                    {
                        title: '金额来源', field: 'priceType', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">系统获取</label>';
                            } else if (value === 2) {
                                return '<label class="badge label-warning">人工编辑</label>';
                            }
                        }
                    },
                    {
                        title: '数据类型', field: 'isPrototypeDataFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">样机数据</label>';
                            } else {
                                return '<label class="badge label-warning">导入数据</label>';
                            }
                        }
                    },
                    {
                        title: '数据状态', field: 'isEffectiveFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">有效</label>';
                            } else {
                                return '<label class="badge label-danger">无效</label>';
                            }
                        }
                    },
                    {
                        title: '操作',
                        formatter: function (value, row, index) {
                            let elements = new Array();
                            if (hasP('rou:adjust:edit')) {
                                let mode = $("#mode").val();
                                let finishStatus = $("#queryForm [name='finishStatus']").val();
                                if (mode === 'edit' && finishStatus != 3) {
                                    elements.push('<button style="width: 48px;" class="btn btn-warning btn-xs" onclick="showEditPanel(' + row.id + ')">编辑</button>');
                                    if (row.isEffectiveFlag === 1) {
                                        elements.push('<button style="width: 48px;border-color: #985f0d;border-top-color: rgb(152, 95, 13);border-right-color: rgb(152, 95, 13);border-bottom-color: rgb(152, 95, 13);border-left-color: rgb(152, 95, 13)" class="btn bg-orange btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 2 + ')">无效</button>');

                                    } else if (row.isEffectiveFlag === 2) {
                                        elements.push('<button style="width: 48px" class="btn btn-success btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 1 + ')">有效</button>');
                                        if (mode === 'edit' && finishStatus != 3 && row.isPrototypeDataFlag != 1) {
                                            elements.push('<button style="width: 48px" class="btn btn-danger btn-xs" onclick="removeMat(' + row.id + ')">删除</button>');
                                        }
                                    }
                                }
                            }
                            return elements.join('');
                        }
                    }
                ]
            });
            $("#queryForm [name='auxiliaryMaterials']").val(true);
            table1 = js.table.init({
                id: "bootstrap-table1",
                queryForm: 'queryForm',
                url: ctx + "estimateManage/workingHoursOrAuxiliaryList",
                showColumns: true,
                showExport: true,
                toolbar: '#toolBar1',
                pagination: true,                                   // 是否显示分页
                uniqueId: "id",
                queryParams: function (params) {
                    let curParams = {
                        // 传递参数查询参数
                        pageSize: params.limit,
                        pageNum: params.offset / params.limit + 1,
                        sort: params.sort,
                        order: params.order,
                        dataType: '辅材'
                    };
                    return $.extend(curParams, this.queryData, js.formToJSON(this.queryForm));
                },
                columns: [
                    {
                        checkbox: true,
                        width: '30px'
                    },
                    {
                        title: '序号', field: 'id', width: '60',
                        formatter: function (value, row, index, field) {
                            var pageSize = table1.bootstrapTable('getOptions').pageSize;
                            var pageNumber = table1.bootstrapTable('getOptions').pageNumber;
                            return pageSize * (pageNumber - 1) + index + 1;
                        }
                    },
                    {title: '主要辅材类别', field: 'laborName', width: '200'},
                    {title: '主要辅材用量', field: 'laborNum'},
                    {title: '单位', field: 'unit', width: '50'},
                    {title: '单价', field: 'price'},
                    {
                        title: '成本金额',
                        formatter: function (value, row, index) {
                            return row.laborNum * row.price;
                        }
                    },
                    {title: '备注', field: 'remark'}
                    ,
                    {
                        title: '金额来源', field: 'priceType', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">系统获取</label>';
                            } else if (value === 2) {
                                return '<label class="badge label-warning">人工编辑</label>';
                            }
                        }
                    },
                    {
                        title: '数据类型', field: 'isPrototypeDataFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">样机数据</label>';
                            } else {
                                return '<label class="badge label-warning">导入数据</label>';
                            }
                        }
                    },
                    {
                        title: '数据状态', field: 'isEffectiveFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">有效</label>';
                            } else {
                                return '<label class="badge label-danger">无效</label>';
                            }
                        }
                    },
                    {
                        title: '操作',
                        formatter: function (value, row, index) {
                            let elements = new Array();
                            if (hasP('rou:adjust:edit')) {
                                let mode = $("#mode").val();
                                let finishStatus = $("#queryForm [name='finishStatus']").val();

                                if (mode === 'edit' && finishStatus != 3) {
                                    elements.push('<button style="width: 48px;" class="btn btn-warning btn-xs" onclick="showEditPanel(' + row.id + ')">编辑</button>');
                                    if (row.isEffectiveFlag === 1) {
                                        elements.push('<button style="width: 48px;border-color: #985f0d;border-top-color: rgb(152, 95, 13);border-right-color: rgb(152, 95, 13);border-bottom-color: rgb(152, 95, 13);border-left-color: rgb(152, 95, 13)" class="btn bg-orange btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 2 + ')">无效</button>');

                                    } else if (row.isEffectiveFlag === 2) {
                                        elements.push('<button style="width: 48px" class="btn btn-success btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 1 + ')">有效</button>');
                                        if (mode === 'edit' && finishStatus != 3 && row.isPrototypeDataFlag != 1) {
                                            elements.push('<button style="width: 48px" class="btn btn-danger btn-xs" onclick="removeMat(' + row.id + ')">删除</button>');
                                        }
                                    }
                                }
                            }
                            return elements.join('');
                        }
                    }
                ]
            });
        } else if (costCode.indexOf("包装运输费-运输费") > -1) {
            table = js.table.init({
                id: "bootstrap-table",
                queryForm: 'queryForm',
                url: ctx + "estimateManage/workingHoursOrAuxiliaryList",
                showColumns: true,
                showExport: true,
                pagination: true,                                   // 是否显示分页
                toolbar: '#toolBar',
                uniqueId: "id",
                queryParams: function (params) {
                    let curParams = {
                        // 传递参数查询参数
                        pageSize: params.limit,
                        pageNum: params.offset / params.limit + 1,
                        sort: params.sort,
                        order: params.order,
                        dataType: '运输费'
                    };
                    return $.extend(curParams, this.queryData, js.formToJSON(this.queryForm));
                },
                onLoadSuccess: function (data) {
                },
                columns: [
                    {
                        checkbox: true,
                        width: '30px'
                    },
                    {
                        title: '序号', field: 'id', width: '60',
                        formatter: function (value, row, index, field) {
                            var pageSize = table.bootstrapTable('getOptions').pageSize;
                            var pageNumber = table.bootstrapTable('getOptions').pageNumber;
                            return pageSize * (pageNumber - 1) + index + 1;
                        }
                    },
                    {title: '发货地', field: 'placeDelivery'},
                    {title: '目的地', field: 'destination'},
                    {title: '重量（t）', field: 'laborNum'},
                    {title: '车数（车）', field: 'carNum'},
                    {title: '距离（km）', field: 'distance'},
                    {title: '运费（元）', field: 'price'},
                    {title: '备注', field: 'remark'}
                    ,
                    {
                        title: '金额来源', field: 'priceType', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">系统获取</label>';
                            } else if (value === 2) {
                                return '<label class="badge label-warning">人工编辑</label>';
                            }
                        }
                    },
                    {
                        title: '数据类型', field: 'isPrototypeDataFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">样机数据</label>';
                            } else {
                                return '<label class="badge label-warning">导入数据</label>';
                            }
                        }
                    },
                    {
                        title: '数据状态', field: 'isEffectiveFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">有效</label>';
                            } else {
                                return '<label class="badge label-danger">无效</label>';
                            }
                        }
                    },
                    {
                        title: '操作',
                        formatter: function (value, row, index) {
                            let elements = new Array();
                            if (hasP('rou:adjust:edit')) {
                                let mode = $("#mode").val();
                                let finishStatus = $("#queryForm [name='finishStatus']").val();
                                if (mode === 'edit' && finishStatus != 3) {
                                    elements.push('<button style="width: 48px;" class="btn btn-warning btn-xs" onclick="showEditPanel(' + row.id + ')">编辑</button>');
                                    if (row.isEffectiveFlag === 1) {
                                        elements.push('<button style="width: 48px;border-color: #985f0d;border-top-color: rgb(152, 95, 13);border-right-color: rgb(152, 95, 13);border-bottom-color: rgb(152, 95, 13);border-left-color: rgb(152, 95, 13)" class="btn bg-orange btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 2 + ')">无效</button>');

                                    } else if (row.isEffectiveFlag === 2) {
                                        elements.push('<button style="width: 48px" class="btn btn-success btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 1 + ')">有效</button>');
                                        if (mode === 'edit' && finishStatus != 3 && row.isPrototypeDataFlag != 1) {
                                            elements.push('<button style="width: 48px" class="btn btn-danger btn-xs" onclick="removeMat(' + row.id + ')">删除</button>');
                                        }
                                    }
                                }
                            }
                            return elements.join('');
                        }
                    }
                ]
            });
        } else if (costCode.indexOf("备品备件") > -1) {
            table = js.table.init({
                id: "bootstrap-table",
                queryForm: 'queryForm',
                url: ctx + "estimateManage/purList",
                showColumns: true,
                showExport: true,
                pagination: true,                                   // 是否显示分页
                toolbar: '#toolBar',
                uniqueId: "id",
                queryParams: function (params) {
                    let curParams = {
                        // 传递参数查询参数
                        pageSize: params.limit,
                        pageNum: params.offset / params.limit + 1,
                        sort: params.sort,
                        order: params.order
                    };
                    return $.extend(curParams, this.queryData, js.formToJSON(this.queryForm));
                },
                onLoadSuccess: function (data) {
                },
                columns: [
                    {
                        checkbox: true,
                        width: '30px'
                    },
                    {
                        title: '序号', field: 'id', width: '60',
                        formatter: function (value, row, index, field) {
                            var pageSize = table.bootstrapTable('getOptions').pageSize;
                            var pageNumber = table.bootstrapTable('getOptions').pageNumber;
                            return pageSize * (pageNumber - 1) + index + 1;
                        }
                    },
                    {title: '部分', field: 'part', width: '120'},
                    {title: '专业', field: 'major'},
                    {title: '提报计划物料描述', field: 'matDesc', width: '200'},
                    {title: '实用数量', field: 'num'},
                    {title: '单位', field: 'unit', width: '50'},
                    {title: '型号/标准号', field: 'standardNo'},
                    {title: '品牌', field: 'brand'},
                    {title: '备注', field: 'remark'},
                    {title: 'SAP物料编码', field: 'sapCode'},
                    {title: '采购物料描述', field: 'buyMatDesc'},
                    {title: '单价', field: 'price', width: '50'},
                    {
                        title: '总价', width: '50',
                        formatter: function (value, row) {
                            return row.num * row.price;
                        }
                    },
                    {
                        title: '金额来源', field: 'priceType', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">系统获取</label>';
                            } else if (value === 2) {
                                return '<label class="badge label-warning">人工编辑</label>';
                            }
                        }
                    },
                    {
                        title: '数据类型', field: 'isPrototypeDataFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">样机数据</label>';
                            } else {
                                return '<label class="badge label-warning">导入数据</label>';
                            }
                        }
                    },
                    {
                        title: '数据状态', field: 'isEffectiveFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">有效</label>';
                            } else {
                                return '<label class="badge label-danger">无效</label>';
                            }
                        }
                    },
                    {
                        title: '操作',
                        formatter: function (value, row, index) {
                            let elements = new Array();
                            if (hasP('rou:adjust:edit')) {
                                let mode = $("#mode").val();
                                let finishStatus = $("#queryForm [name='finishStatus']").val();
                                if (mode === 'edit' && finishStatus != 3) {
                                    elements.push('<button style="width: 48px;" class="btn btn-warning btn-xs" onclick="showEditPanel(' + row.id + ')">编辑</button>');
                                    if (row.isEffectiveFlag === 1) {
                                        elements.push('<button style="width: 48px;border-color: #985f0d;border-top-color: rgb(152, 95, 13);border-right-color: rgb(152, 95, 13);border-bottom-color: rgb(152, 95, 13);border-left-color: rgb(152, 95, 13)" class="btn bg-orange btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 2 + ')">无效</button>');

                                    } else if (row.isEffectiveFlag === 2) {
                                        elements.push('<button style="width: 48px" class="btn btn-success btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 1 + ')">有效</button>');
                                        if (mode === 'edit' && finishStatus != 3 && row.isPrototypeDataFlag != 1) {
                                            elements.push('<button style="width: 48px" class="btn btn-danger btn-xs" onclick="removeMat(' + row.id + ')">删除</button>');
                                        }
                                    }
                                }
                            }
                            return elements.join('');
                        }
                    }
                ]
            });
        } else if (costCode.indexOf("随机备件") > -1) {
            table = js.table.init({
                id: "bootstrap-table",
                queryForm: 'queryForm',
                url: ctx + "estimateManage/purList",
                showColumns: true,
                showExport: true,
                pagination: true,                                   // 是否显示分页
                toolbar: '#toolBar',
                uniqueId: "id",
                queryParams: function (params) {
                    let curParams = {
                        // 传递参数查询参数
                        pageSize: params.limit,
                        pageNum: params.offset / params.limit + 1,
                        sort: params.sort,
                        order: params.order
                    };
                    return $.extend(curParams, this.queryData, js.formToJSON(this.queryForm));
                },
                onLoadSuccess: function (data) {
                },
                columns: [
                    {
                        checkbox: true,
                        width: '30px'
                    },
                    {
                        title: '序号', field: 'id', width: '60',
                        formatter: function (value, row, index, field) {
                            var pageSize = table.bootstrapTable('getOptions').pageSize;
                            var pageNumber = table.bootstrapTable('getOptions').pageNumber;
                            return pageSize * (pageNumber - 1) + index + 1;
                        }
                    },
                    {title: '部分', field: 'part', width: '120'},
                    {title: '专业', field: 'major'},
                    {title: '提报计划物料描述', field: 'matDesc', width: '200'},
                    {title: '实用数量', field: 'num'},
                    {title: '单位', field: 'unit', width: '50'},
                    {title: '型号/标准号', field: 'standardNo'},
                    {title: '品牌', field: 'brand'},
                    {title: '备注', field: 'remark'},
                    {title: 'SAP物料编码', field: 'sapCode'},
                    {title: '采购物料描述', field: 'buyMatDesc'},
                    {title: '单价', field: 'price', width: '50'},
                    {
                        title: '总价', width: '50',
                        formatter: function (value, row) {
                            return row.num * row.price;
                        }
                    },
                    {
                        title: '金额来源', field: 'priceType', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">系统获取</label>';
                            } else if (value === 2) {
                                return '<label class="badge label-warning">人工编辑</label>';
                            }
                        }
                    },
                    {
                        title: '数据类型', field: 'isPrototypeDataFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">样机数据</label>';
                            } else {
                                return '<label class="badge label-warning">导入数据</label>';
                            }
                        }
                    },
                    {
                        title: '数据状态', field: 'isEffectiveFlag', width: '65',
                        formatter: function (value, row, index) {
                            if (value === 1) {
                                return '<label class="badge label-success">有效</label>';
                            } else {
                                return '<label class="badge label-danger">无效</label>';
                            }
                        }
                    },
                    {
                        title: '操作',
                        formatter: function (value, row, index) {
                            let elements = new Array();
                            if (hasP('rou:adjust:edit')) {
                                let mode = $("#mode").val();
                                let finishStatus = $("#queryForm [name='finishStatus']").val();
                                if (mode === 'edit' && finishStatus != 3) {
                                    elements.push('<button style="width: 48px;" class="btn btn-warning btn-xs" onclick="showEditPanel(' + row.id + ')">编辑</button>');
                                    if (row.isEffectiveFlag === 1) {
                                        elements.push('<button style="width: 48px;border-color: #985f0d;border-top-color: rgb(152, 95, 13);border-right-color: rgb(152, 95, 13);border-bottom-color: rgb(152, 95, 13);border-left-color: rgb(152, 95, 13)" class="btn bg-orange btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 2 + ')">无效</button>');

                                    } else if (row.isEffectiveFlag === 2) {
                                        elements.push('<button style="width: 48px" class="btn btn-success btn-xs" onclick="changeIsEffectiveFlag(' + row.id + ',' + 1 + ')">有效</button>');
                                        if (mode === 'edit' && finishStatus != 3 && row.isPrototypeDataFlag != 1) {
                                            elements.push('<button style="width: 48px" class="btn btn-danger btn-xs" onclick="removeMat(' + row.id + ')">删除</button>');
                                        }
                                    }
                                }
                            }
                            return elements.join('');
                        }
                    }
                ]
            });
        }
    }


    /**
     * 打开编辑面板
     */
    function showEditPanel(id) {
        let rowData = $('#bootstrap-table').bootstrapTable('getRowByUniqueId', id);
        if (rowData === null) {
            rowData = $('#bootstrap-table1').bootstrapTable('getRowByUniqueId', id);
        }
        let costCode = $("#queryForm [name='costCode']").val();
        if (costCode.indexOf('-材料费-材料采购费-') > -1) {
            $("#edit-form .modal-header").html('<input name="id" type="hidden" style="display: none"/>' +
                '                    <input name="priceType" type="hidden" style="display: none"/>' +
                '                    <input name="costId" value="' + $("#queryForm [name='id']").val() + '" type="hidden" style="display: none"/>' +
                '                    <div class="col-md-12">' +
                '                        <div class="form-group">' +
                '                            <label class="control-label">单价:</label>' +
                '                            <label class="control-label">' +
                '                                <input name="price" type="number" class="form-control" min="0" max="210000000"' +
                '                                       step="0.01"/>' +
                '                            </label>' +
                '                        </div>' +
                '                    </div>');
            /** 验证 */
            js.validate.init("edit-form", {
                fields: {
                    price: {
                        validators: {
                            notEmpty: {message: '请输入单价'}
                        }
                    }
                }
            });
            $("#edit-form").fillData(rowData);
            js.modal.open('modal-edit');
        } else if (costCode.indexOf('-制造费-') > -1 && rowData.laborType === 4) {
            $("#edit-form .modal-header").html('<input name="id" type="hidden" style="display: none"/>' +
                '                    <input name="priceType" type="hidden"/>' +
                '                    <input name="costId" value="' + $("#queryForm [name='id']").val() + '" type="hidden" style="display: none"/>' +
                '                    <div class="col-md-12">' +
                '                        <div class="form-group">' +
                '                            <label class="control-label">数量:</label>' +
                '                            <label class="control-label">' +
                '                                <input name="laborNum" type="number" class="form-control" min="0" max="210000000"' +
                '                                       step="0.01"/>' +
                '                            </label>' +
                '                        </div>' +
                '                    </div>');
            /** 验证 */
            js.validate.init("edit-form", {
                fields: {
                    laborNum: {
                        validators: {
                            notEmpty: {message: '请输入数量'}
                        }
                    }
                }
            });
            $("#edit-form").fillData(rowData);
            js.modal.open('modal-edit');
        } else if (costCode.indexOf('-制造费-') > -1 && costCode.indexOf('-制造费-机加') == -1 && rowData.laborType === 5) {
            $("#edit-form .modal-header").html('<input name="id" type="hidden" style="display: none"/>' +
                '                    <input name="priceType" type="hidden"/>' +
                '                    <input name="costId" value="' + $("#queryForm [name='id']").val() + '" type="hidden" style="display: none"/>' +
                '                    <div class="col-md-12">' + '' +
                '                        <div class="form-group">' +
                '                            <label class="control-label">主要辅材用量:</label>' +
                '                            <label class="control-label">' +
                '                                <input name="laborNum" type="number" class="form-control" min="0" max="210000000"' +
                '                                       step="0.01"/>' +
                '                            </label>' +
                '                        </div>' +
                '                        <div class="form-group">' +
                '                            <label class="control-label">单价:</label>' +
                '                            <label class="control-label">' +
                '                                <input name="price" type="number" class="form-control" min="0" max="210000000"' +
                '                                       step="0.01"/>' +
                '                            </label>' +
                '                        </div>' +
                '                        <div class="form-group">' +
                '                            <label class="control-label">单位:</label>' +
                '                            <label class="control-label">' +
                '                                <input name="unit" type="text" class="form-control" maxlength="255" />' +
                '                            </label>' +
                '                        </div>' +
                '                    </div>');
            /** 验证 */
            js.validate.init("edit-form", {
                fields: {
                    laborNum: {
                        validators: {
                            notEmpty: {message: '请输入主要辅材数量'}
                        }
                    },
                    price: {
                        validators: {
                            notEmpty: {message: '请输入单价'}
                        }
                    },
                    unit: {
                        validators: {
                            notEmpty: {message: '请输入单位'}
                        }
                    }
                }
            });
            $("#edit-form").fillData(rowData);
            js.modal.open('modal-edit');
        } else if (costCode.indexOf('-制造费-') > -1 && costCode.indexOf('-制造费-机加') > -1) {
            $("#macHoursEditForm").fillData(rowData);
            js.modal.open('modal-mac-edit');
        } else if (costCode.indexOf('-制造费-') > -1 && costCode.indexOf('-制造费-喷涂') > -1) {
            $("#li-hour-sprays").removeClass("active");
            $("#li-aux-spray").removeClass("active");
            $("#hoursSpray").removeClass("active");
            $("#auxSpray").removeClass("active");
            if (rowData.laborType === 9 || rowData.laborType === 11) {
                $("#sprayHoursEditForm").fillData(rowData);
                $("#li-hour-sprays").addClass("active");
                $("#hoursSpray").addClass("active");
            } else {
                $("#sprayAuxEditForm").fillData(rowData);
                $("#li-aux-spray").addClass("active");
                $("#auxSpray").addClass("active");
            }
            js.modal.open('modal-spray-edit');
        } else if (costCode.indexOf('-制造费-') > -1 && costCode.indexOf('-制造费-热处理') > -1) {
            $("#heatTreatmentEditForm").fillData(rowData);
            js.modal.open('modal-heatTreatment-edit');
        } else if (costCode.indexOf('-外购费') > -1 || costCode.indexOf('备品备件') > -1 || costCode.indexOf('随机备件') > -1) {
            $("#purAddForm").fillData(rowData);
            js.modal.open('modal-pur-add');
        } else if (costCode.indexOf('-整体外协') > -1) {
            $("#wholeAddForm").fillData(rowData);
            js.modal.open('modal-whole-add');
        } else if (costCode.indexOf('-带料外协') > -1) {
            $("#whithMatAddForm").fillData(rowData);
            js.modal.open('modal-whithMat-add');
        } else if (costCode.indexOf('-现场安装费-人工-安装人工') > -1) {
            $("#installHoursAddForm").fillData(rowData);
            js.modal.open('modal-install-add');
            $("#installHoursAddForm [name='dataType']").val('工时');
        } else if (costCode.indexOf('-现场安装费-人工-调试人工') > -1) {
            $("#debugHoursAddForm").fillData(rowData);
            js.modal.open('modal-debug-add');
            $("#debugHoursAddForm [name='dataType']").val('工时');
        } else if (costCode.indexOf('-现场安装费-辅材') > -1) {
            $("#auxAddForm").fillData(rowData);
            js.modal.open('modal-aux-add');
            $("#auxAddForm [name='dataType']").val('辅材');
        } else if (costCode.indexOf('-设计费') > -1 && rowData.laborType === 1) {
            $("#dsnHoursAddForm").fillData(rowData);
            js.modal.open('modal-dsn-hours-add');
            $("#dsnHoursAddForm [name='dataType']").val('工时');
        } else if (costCode.indexOf('-设计费') > -1 && (rowData.laborType === 2 || rowData.laborType === 3)) {
            $("#dsnWeightAddForm").fillData(rowData);
            js.modal.open('modal-dsn-weight-add');
            $("#dsnWeightAddForm [name='dataType']").val('重量');
        } else if (costCode.indexOf('包装运输费-包装费') > -1 && rowData.laborType === 15) {
            $("#packingHoursAddForm").fillData(rowData);
            js.modal.open('modal-packing-hours-add');
            $("#packingHoursAddForm [name='dataType']").val('工时');
        } else if (costCode.indexOf('包装运输费-包装费') > -1 && rowData.laborType === 16) {
            $("#packingAuxAddForm").fillData(rowData);
            js.modal.open('modal-packing-aux-add');
            $("#packingAuxAddForm [name='dataType']").val('辅材');
        } else if (costCode.indexOf('包装运输费-运输费') > -1) {
            $("#transportAddForm").fillData(rowData);
            js.modal.open('modal-transport-add');
            $("#transportAddForm [name='dataType']").val('运输费');
        }

    }

    /**
     * 有效无效
     * @param id
     * @param isEffectiveFlag
     */
    function changeIsEffectiveFlag(id, isEffectiveFlag) {
        if (id === '') {
            let arr = js.table.selectColumns(table, "id");
            let arr1 = new Array();
            if (table1 != undefined) {
                arr1 = js.table.selectColumns(table1, "id");
            }
            for (let i = 0; i < arr1.length; i++) {
                arr.push(arr1[i]);
            }
            if (arr.length < 1) {
                js.modal.warning("请选择要操作的数据！");
                return;
            } else {
                id = arr.join(',');
            }
        }
        let code = $("#queryForm [name='costCode']").val();
        if (code.indexOf("-材料费-材料采购费-") > -1 ||
            code.indexOf("-外购费") > -1 ||
            code.indexOf("-整体外协") > -1 ||
            code.indexOf("-带料外协") > -1 ||
            code.indexOf("备品备件") > -1 ||
            code.indexOf("随机备件") > -1) {
            js.post({
                url: ctx + 'estimateManage/changeIsEffectiveFlagByMat',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: {
                    ids: id,
                    isEffectiveFlag: isEffectiveFlag
                },
                async: true,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        js.modal.success("操作成功！");
                        js.table.refresh(table);
                        if (table1 != undefined) {
                            js.table.refresh(table1);
                        }
                    } else {
                        js.modal.warning("操作失败！");
                        js.table.refresh(table);
                        if (table1 != undefined) {
                            js.table.refresh(table1);
                        }
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        } else if ((code.indexOf("-制造费-") > -1 &&
            code.indexOf("-制造费-机加") === -1) ||
            code.indexOf("-现场安装费-人工-安装人工") > -1 ||
            code.indexOf("-现场安装费-人工-调试人工") > -1 ||
            code.indexOf("-现场安装费-辅材") > -1 ||
            code.indexOf("-设计费") > -1 ||
            code.indexOf("包装运输费-包装费") > -1 ||
            code.indexOf("包装运输费-运输费") > -1) {
            js.post({
                url: ctx + 'estimateManage/changeIsEffectiveFlagByMan',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: {
                    ids: id,
                    isEffectiveFlag: isEffectiveFlag
                },
                async: true,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        js.modal.success("操作成功！");
                        js.table.refresh(table);
                        if (table1 != undefined) {
                            js.table.refresh(table1);
                        }
                    } else {
                        js.modal.warning("操作失败！");
                        js.table.refresh(table);
                        if (table1 != undefined) {
                            js.table.refresh(table1);
                        }
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        } else if (code.indexOf("-制造费-") > -1 && code.indexOf("-制造费-机加") != -1) {
            js.post({
                url: ctx + 'estimateManage/changeIsEffectiveFlagByMac',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: {
                    ids: id,
                    isEffectiveFlag: isEffectiveFlag
                },
                async: true,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        js.modal.success("操作成功！");
                        js.table.refresh(table);
                    } else {
                        js.modal.warning("操作失败！");
                        js.table.refresh(table);
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        }
    }

    /**
     * 删除数据
     * @param id
     */
    function removeMat(id) {
        let code = $("#queryForm [name='costCode']").val();
        if (id === '') {
            let arr = js.table.selectColumns(table, "id");
            let arr1 = new Array();
            if (table1 != undefined) {
                arr1 = js.table.selectColumns(table1, "id");
                for (let i = 0; i < arr1.length; i++) {
                    arr.push(arr1[i]);
                }
            }
            if (arr.length < 1) {
                js.modal.warning("请选择要删除的数据！");
                return;
            } else {
                id = arr.join(',');
            }
        }
        if (code.indexOf("-材料费-材料采购费-") > -1 ||
            code.indexOf("-外购费") > -1 ||
            code.indexOf("-整体外协") > -1 ||
            code.indexOf("-带料外协") > -1 ||
            code.indexOf("备品备件") > -1 ||
            code.indexOf("随机备件") > -1) {
            js.confirmPost({
                content: "尊敬的用户，您确认要删除此条数据吗？",
                url: ctx + 'estimateManage/removeMat',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: {ids: id},
                async: true,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        js.modal.success("操作成功！");
                        js.table.refresh(table);
                        $this.attr('disabled', false);
                    } else {
                        js.modal.success("操作失败！");
                        js.table.refresh(table);
                        $this.attr('disabled', false);
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        } else if ((code.indexOf("-制造费-") > -1 &&
            code.indexOf("-制造费-机加") === -1) ||
            code.indexOf("-现场安装费-人工-安装人工") > -1 ||
            code.indexOf("-现场安装费-人工-调试人工") > -1 ||
            code.indexOf("-现场安装费-辅材") > -1 ||
            code.indexOf("-设计费") > -1 ||
            code.indexOf("包装运输费-包装费") > -1 ||
            code.indexOf("包装运输费-运输费") > -1) {
            js.confirmPost({
                content: "尊敬的用户，您确认要删除此条数据吗？",
                url: ctx + 'estimateManage/removeMan',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: {ids: id},
                async: true,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        js.modal.success("操作成功！");
                        js.table.refresh(table);
                        if (table1 != undefined) {
                            js.table.refresh(table1);
                        }
                    } else {
                        js.modal.warning("操作失败！");
                        js.table.refresh(table);
                        if (table1 != undefined) {
                            js.table.refresh(table1);
                        }
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        } else if (code.indexOf("-制造费-") > -1 && code.indexOf("-制造费-机加") > -1) {
            js.confirmPost({
                content: "尊敬的用户，您确认要删除此条数据吗？",
                url: ctx + 'estimateManage/removeMac',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: {ids: id},
                async: true,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        js.modal.success("操作成功！");
                        js.table.refresh(table);
                        if (table1 != undefined) {
                            js.table.refresh(table1);
                        }
                    } else {
                        js.modal.warning("操作失败！");
                        js.table.refresh(table);
                        if (table1 != undefined) {
                            js.table.refresh(table1);
                        }
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        }
    }

    /**
     * 清空数据
     */
    function clearMat() {
        let code = $("#queryForm [name='costCode']").val();
        if (code.indexOf("-材料费-材料采购费-") > -1) {
            js.confirmPost({
                content: "尊敬的用户，您确认要清空此成本项的所有数据吗？",
                url: ctx + 'estimateManage/clearMat',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: {costId: $("#queryForm [name='id']").val()},
                async: true,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        js.modal.success("操作成功！");
                        js.table.refresh(table);
                        if (table1 != undefined) {
                            js.table.refresh(table1);
                        }
                        $this.attr('disabled', false);
                    } else {
                        js.modal.success("操作失败！");
                        js.table.refresh(table);
                        if (table1 != undefined) {
                            js.table.refresh(table1);
                        }
                        $this.attr('disabled', false);
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        } else if (code.indexOf("-制造费-") > -1 && code.indexOf("-制造费-机加") === -1) {
            js.confirmPost({
                content: "尊敬的用户，您确认要清空此成本项的所有数据吗？",
                url: ctx + 'estimateManage/clearHours',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: {costId: $("#queryForm [name='id']").val()},
                async: true,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        js.modal.success("操作成功！");
                        js.table.refresh(table);
                        if (table1 != undefined) {
                            js.table.refresh(table1);
                        }
                        $this.attr('disabled', false);
                    } else {
                        js.modal.success("操作失败！");
                        js.table.refresh(table);
                        if (table1 != undefined) {
                            js.table.refresh(table1);
                        }
                        $this.attr('disabled', false);
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        } else if (code.indexOf("-制造费-") > -1 && code.indexOf("-制造费-机加") > -1) {
            js.confirmPost({
                content: "尊敬的用户，您确认要清空此成本项的所有数据吗？",
                url: ctx + 'estimateManage/clearHoursMac',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: {costId: $("#queryForm [name='id']").val()},
                async: true,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        js.modal.success("操作成功！");
                        js.table.refresh(table);
                        $this.attr('disabled', false);
                    } else {
                        js.modal.success("操作失败！");
                        js.table.refresh(table);
                        $this.attr('disabled', false);
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        }
    }

    /**
     * 去掉小数点后面多余的0
     * @param number
     * @returns {number}
     */
    function dealingWithDecimals(number) {
        return parseFloat(number);
    }

    /**
     * 验证输入有效的整数和四位小数
     */
    function formatNumber(obj) {
        obj.value = obj.value.replace(/[^-\d.]/g, "");  //清除“数字”和“.”以外的字符
        obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的
        obj.value = obj.value.replace(/\-{2,}-/g, "-"); //只保留第一个. 清除多余的
        obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
        obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/, '$1$2.$3');//只能输入两个小数
        if (obj.value.indexOf(".") < 0 && obj.value != "") {//以上已经过滤，此处控制的是如果没有小数点，首位不能为类似于 01、02的金额
            obj.value = obj.value;
        }
        //如果上去就写- 自动替换
        if (obj.value.indexOf("-") >= 0) {
            obj.value = obj.value.replace('-', "");
        }
        //如果上去就写.   自动补个0   形成0.
        if (obj.value.indexOf(".") == 0) {
            obj.value = "0" + obj.value;
        } else if (obj.value.indexOf(".") > 1) {
            //如果输入01.3自动变成1.3，自动去除整数部分的0
            if (obj.value.indexOf("0") == 0) {
                obj.value = obj.value.substr(1, obj.value.length - 1);
            }
        }
        //如果输入023直接变成23;自动去除整数部分的0
        if (obj.value.length > 2 && obj.value.indexOf(".") < 0) {
            if (obj.value.indexOf("0") == 0) {
                obj.value = obj.value.substr(1, obj.value.length - 1);
            }
        }
    }

    /**
     * 获取原材料金额
     */
    function getRawMatAmount() {
        let code = $("#queryForm [name='costCode']").val();
        if (code.indexOf('-材料费-材料采购费-') > -1) {
            js.post({
                url: ctx + 'estimateManage/getRawMatAmount',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: {
                    id: $("#queryForm [name='id']").val()
                },
                async: true,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        $("#input_amount").val(parseFloat(result.data.amount));
                        $("#input_tax_amount").val(parseFloat(result.data.amountTax));
                        $("#input_cost_totalPrice").val(result.data.costTotalPrice);
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        } else if (code.indexOf('-制造费-') > -1 || code.indexOf('包装运输费-包装费') > -1) {
            js.post({
                url: ctx + 'estimateManage/getCutAmount',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: {
                    id: $("#queryForm [name='id']").val()
                },
                async: true,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        $("#input_amount").val(parseFloat(result.data.amount));
                        $("#input_tax_amount").val(parseFloat(result.data.amountTax));
                        $("#input_cost_totalPrice").val(result.data.costTotalPrice);
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        } else if (code.indexOf('-外购费') > -1) {
            js.post({
                url: ctx + 'estimateManage/getPurAmount',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: {
                    id: $("#queryForm [name='id']").val()
                },
                async: true,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        $("#input_amount").val(parseFloat(result.data.amount));
                        $("#input_tax_amount").val(parseFloat(result.data.amountTax));
                        $("#input_cost_totalPrice").val(result.data.costTotalPrice);
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        } else if (code.indexOf('-整体外协') > -1) {
            js.post({
                url: ctx + 'estimateManage/getWholeAmount',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: {
                    id: $("#queryForm [name='id']").val()
                },
                async: true,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        $("#input_amount").val(parseFloat(result.data.amount));
                        $("#input_tax_amount").val(parseFloat(result.data.amountTax));
                        $("#input_cost_totalPrice").val(result.data.costTotalPrice);
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        } else if (code.indexOf('-带料外协') > -1) {
            js.post({
                url: ctx + 'estimateManage/getWithMatAmount',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: {
                    id: $("#queryForm [name='id']").val()
                },
                async: true,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        $("#input_amount").val(parseFloat(result.data.amount));
                        $("#input_tax_amount").val(parseFloat(result.data.amountTax));
                        $("#input_cost_totalPrice").val(result.data.costTotalPrice);
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        } else if (code.indexOf('-现场安装费-人工-安装人工') > -1) {
            js.post({
                url: ctx + 'estimateManage/getInstallArtificial',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: {
                    id: $("#queryForm [name='id']").val()
                },
                async: true,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        $("#input_amount").val(parseFloat(result.data.amount));
                        $("#lbl_amount1").text("总金额：");
                        $("#lbl_tax_amount").hide();
                        $("#lbl_tax_amount1").hide();
                        $("#lbl_tax_amount2").hide();
                        $("#input_cost_totalPrice").val(result.data.costTotalPrice);
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        } else if (code.indexOf('-现场安装费-人工-调试人工') > -1) {
            js.post({
                url: ctx + 'estimateManage/getDebugArtificial',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: {
                    id: $("#queryForm [name='id']").val()
                },
                async: true,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        $("#input_amount").val(parseFloat(result.data.amount));
                        $("#lbl_amount1").text("总金额：");
                        $("#lbl_tax_amount").hide();
                        $("#lbl_tax_amount1").hide();
                        $("#lbl_tax_amount2").hide();
                        $("#input_cost_totalPrice").val(result.data.costTotalPrice);
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        } else if (code.indexOf('-现场安装费-辅材') > -1) {
            js.post({
                url: ctx + 'estimateManage/getInstallAux',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: {
                    id: $("#queryForm [name='id']").val()
                },
                async: true,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        $("#input_amount").val(parseFloat(result.data.amount));
                        $("#input_tax_amount").val(parseFloat(result.data.amountTax));
                        $("#input_cost_totalPrice").val(result.data.costTotalPrice);
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        } else if (code.indexOf('-设计费') > -1) {
            js.post({
                url: ctx + 'estimateManage/getDesignCostTotalPrice',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: {
                    id: $("#queryForm [name='id']").val()
                },
                async: true,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        $("#lbl_amount1").hide();
                        $("#lbl_amount2").hide();
                        $("#lbl_amount3").hide();
                        $("#lbl_tax_amount").hide();
                        $("#lbl_tax_amount1").hide();
                        $("#lbl_tax_amount2").hide();

                        $("#input_cost_totalPrice").val(result.data.costTotalPrice);
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        } else if (code.indexOf('包装运输费-运输费') > -1) {
            js.post({
                url: ctx + 'estimateManage/getTransportCostTotalPrice',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: {
                    id: $("#queryForm [name='id']").val()
                },
                async: true,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        $("#input_amount").val(parseFloat(result.data.amount));
                        $("#input_tax_amount").val(parseFloat(result.data.amountTax));
                        $("#input_cost_totalPrice").val(result.data.costTotalPrice);
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        } else if (code.indexOf('备品备件') > -1) {
            js.post({
                url: ctx + 'estimateManage/getSparePartsAmount',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: {
                    id: $("#queryForm [name='id']").val()
                },
                async: true,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        $("#input_amount").val(parseFloat(result.data.amount));
                        $("#input_tax_amount").val(parseFloat(result.data.amountTax));
                        $("#input_cost_totalPrice").val(result.data.costTotalPrice);
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        } else if (code.indexOf('随机备件') > -1) {
            js.post({
                url: ctx + 'estimateManage/getAccompanyingSparePartsAmount',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: {
                    id: $("#queryForm [name='id']").val()
                },
                async: true,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        $("#input_amount").val(parseFloat(result.data.amount));
                        $("#input_tax_amount").val(parseFloat(result.data.amountTax));
                        $("#input_cost_totalPrice").val(result.data.costTotalPrice);
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        }
    }

    /**
     * 获取计算结果
     */
    function getResultMacHours() {
        if ($("#macHours").val().length == 0) {
            js.modal.warning("尊敬的用户，请您输入机加工时！");
            return;
        }
        if ($("#accCount").val().length == 0) {
            js.modal.warning("尊敬的用户，请您输入核算项目数量！");
            return;
        }
        if ($("#estCount").val().length == 0) {
            js.modal.warning("尊敬的用户，请您输入概算项目数量！");
            return;
        }
        let macHours = parseFloat($("#macHours").val());
        let accCount = parseFloat($("#accCount").val());
        let estCount = parseFloat($("#estCount").val());
        js.post({
            url: ctx + 'estimateManage/getResultMacHours',
            type: 'post',
            traditional: true,            // 阻止深度序列化， 使参数可以使用数组
            dataType: 'json',
            contentType: "application/x-www-form-urlencoded",
            data: {
                macHours: macHours,
                accCount: accCount,
                estCount: estCount
            },
            async: true,                // 异步执行
            success: function (result) {
                if (result.type === web_status.SUCCESS) {
                    $("#resultMacHours").val(parseFloat(result.data));
                }
            },
            error: function () {
                js.modal.fail();
            }
        });
    }

    //只能输入整数
    function intValidator(e) {
        let value = e.target.value;
        value = value.replace(/\D+/, "");
        if (value.length > 0) {
            if (value.length > 1 && value[0] == 0) {
                e.target.value = value.substring(1, value.length);
                return;
            }
            //判断不要超过9位
            if (value.length > 9) {
                e.target.value = value.slice(0, 9)
            } else {
                e.target.value = value;
            }
        } else {
            e.target.value = 0;
        }
        ;
    }

    //只能输入整数
    function intValidator2(e) {
        let value = e.target.value;
        value = value.replace(/\D+/, "");
        if (value.length > 0) {
            if (value.length > 1 && value[0] == 0) {
                e.target.value = value.substring(1, value.length);
                return;
            }
            //判断不要超过9位
            if (value > 59) {
                e.target.value = 59
            } else {
                e.target.value = value;
            }
        } else {
            e.target.value = 0;
        }
        ;
    }

    /**
     * 获取工序列表
     */
    function loadProcessList() {
        js.post({
            url: ctx + 'estimateManage/loadProcessList',
            type: 'post',
            traditional: true,            // 阻止深度序列化， 使参数可以使用数组
            dataType: 'json',
            contentType: "application/x-www-form-urlencoded",
            data: {},
            async: true,                // 异步执行
            success: function (result) {
                if (result.type === web_status.SUCCESS) {
                    $("#macHoursAddForm [name='process']").empty();
                    $("#macHoursEditForm [name='process']").empty();
                    let list = result.data;
                    for (let item of list) {
                        $("#macHoursAddForm [name='process']").append('<option value="' + item.name + '">' + item.name + '</option>');
                        $("#macHoursEditForm [name='process']").append('<option value="' + item.name + '">' + item.name + '</option>');
                    }
                }
            },
            error: function () {
                js.modal.fail();
            }
        });
    }

    /**
     * 获取设备类型列表
     */
    function loadNameTypeList() {
        js.post({
            url: ctx + 'estimateManage/loadNameTypeList',
            type: 'post',
            traditional: true,            // 阻止深度序列化， 使参数可以使用数组
            dataType: 'json',
            contentType: "application/x-www-form-urlencoded",
            data: {},
            async: true,                // 异步执行
            success: function (result) {
                if (result.type === web_status.SUCCESS) {
                    $("#macHoursAddForm [name='nameType']").empty();
                    $("#macHoursEditForm [name='nameType']").empty();
                    let list = result.data;
                    for (let item of list) {
                        $("#macHoursAddForm [name='nameType']").append('<option value="' + item.name + '">' + item.name + '</option>');
                        $("#macHoursEditForm [name='nameType']").append('<option value="' + item.name + '">' + item.name + '</option>');
                    }
                    loadNameList();
                }
            },
            error: function () {
                js.modal.fail();
            }
        });
    }

    /**
     * 获取设备列表
     */
    function loadNameList() {
        js.post({
            url: ctx + 'estimateManage/loadNameList',
            type: 'post',
            traditional: true,            // 阻止深度序列化， 使参数可以使用数组
            dataType: 'json',
            contentType: "application/x-www-form-urlencoded",
            data: {
                nameType: $("#macHoursAddForm [name='nameType']").val()
            },
            async: true,                // 异步执行
            success: function (result) {
                if (result.type === web_status.SUCCESS) {
                    $("#macHoursAddForm [name='name']").empty();
                    $("#macHoursEditForm [name='name']").empty();
                    let list = result.data;
                    for (let item of list) {
                        $("#macHoursAddForm [name='name']").append('<option value="' + item.name + '">' + item.name + '</option>');
                        $("#macHoursEditForm [name='name']").append('<option value="' + item.name + '">' + item.name + '</option>');
                    }
                }
            },
            error: function () {
                js.modal.fail();
            }
        });
    }


    function changeNumberVal(obj) {
    }

    function loadMatDescList() {
        let keyStr = $("#purAddForm [name ='matDesc']").val().trim()
        if (keyStr.length > 0) {
            js.post({
                url: ctx + 'estimateManage/loadMatDescList',
                type: 'post',
                traditional: true,            // 阻止深度序列化， 使参数可以使用数组
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded",
                data: {
                    keyStr: keyStr
                },
                async: false,                // 异步执行
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        $("#matDescList").empty();
                        let list = result.data;
                        for (let item of list) {
                            $("#matDescList").append('<option value="' + item.matDesc + '">' + item.matDesc + '</option>');
                        }
                    }
                },
                error: function () {
                    js.modal.fail();
                }
            });
        }
    }

    function clearItem(obj) {
        $(obj).empty();
    }


</script>
</body>
</html>